mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-03-18 21:30:44 +01:00
20 lines
469 B
JavaScript
20 lines
469 B
JavaScript
import {topicUrl, shortTopicUrl, topicUrlWs} from './utils';
|
|
|
|
export default class Subscription {
|
|
url = '';
|
|
baseUrl = '';
|
|
topic = '';
|
|
notifications = [];
|
|
constructor(baseUrl, topic) {
|
|
this.url = topicUrl(baseUrl, topic);
|
|
this.baseUrl = baseUrl;
|
|
this.topic = topic;
|
|
}
|
|
wsUrl() {
|
|
return topicUrlWs(this.baseUrl, this.topic);
|
|
}
|
|
shortUrl() {
|
|
return shortTopicUrl(this.baseUrl, this.topic);
|
|
}
|
|
}
|