🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@nextcloud/notify_push

Package Overview
Dependencies
Maintainers
6
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextcloud/notify_push - npm Package Compare versions

Comparing version
1.0.1
to
1.1.0
+6
-0
dist/index.d.ts

@@ -12,2 +12,8 @@ declare global {

/**
* Get the list of supported notification types as reported by the server
*
* @return string[]
*/
export declare function getSupportedTypes(): string[];
/**
* Register a listener for notify_push events

@@ -14,0 +20,0 @@ *

+25
-2

@@ -39,3 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.listen = void 0;
exports.listen = exports.getSupportedTypes = void 0;
var capabilities_1 = require("@nextcloud/capabilities");

@@ -45,2 +45,17 @@ var axios_1 = require("@nextcloud/axios");

/**
* Get the list of supported notification types as reported by the server
*
* @return string[]
*/
function getSupportedTypes() {
var capabilities = capabilities_1.getCapabilities();
if (capabilities.notify_push) {
return capabilities.notify_push.type;
}
else {
return [];
}
}
exports.getSupportedTypes = getSupportedTypes;
/**
* Register a listener for notify_push events

@@ -58,3 +73,8 @@ *

window._notify_push_listeners[name].push(handler);
setupSocket();
if (window._notify_push_ws !== null && typeof window._notify_push_ws === "object") {
window._notify_push_ws.send('listen ' + name);
}
else {
setupSocket();
}
return window._notify_push_available;

@@ -104,2 +124,5 @@ }

window._notify_push_ws.send(response.data);
for (var name_1 in window._notify_push_listeners) {
window._notify_push_ws.send('listen ' + name_1);
}
}

@@ -106,0 +129,0 @@ };

@@ -15,2 +15,17 @@ import { getCapabilities } from '@nextcloud/capabilities';

/**
* Get the list of supported notification types as reported by the server
*
* @return string[]
*/
export function getSupportedTypes(): string[] {
const capabilities = getCapabilities() as Capabilities;
if (capabilities.notify_push) {
return capabilities.notify_push.type
} else {
return [];
}
}
/**
* Register a listener for notify_push events

@@ -30,3 +45,7 @@ *

window._notify_push_listeners[name].push(handler);
setupSocket();
if (window._notify_push_ws !== null && typeof window._notify_push_ws === "object") {
window._notify_push_ws.send('listen ' + name);
} else {
setupSocket();
}

@@ -56,2 +75,3 @@ return window._notify_push_available;

notify_push?: {
type: string[],
endpoints: {

@@ -86,2 +106,6 @@ pre_auth: string,

window._notify_push_ws.send(response.data)
for (let name in window._notify_push_listeners) {
window._notify_push_ws.send('listen ' + name);
}
}

@@ -88,0 +112,0 @@ }

+1
-1
{
"name": "@nextcloud/notify_push",
"version": "1.0.1",
"version": "1.1.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -1,4 +0,4 @@

# @nextcloud/event-bus
# @nextcloud/notify_push
[![npm](https://img.shields.io/npm/v/@nextcloud/event-bus.svg)](https://www.npmjs.com/package/@nextcloud/notify_push)
[![npm](https://img.shields.io/npm/v/@nextcloud/notify_push.svg)](https://www.npmjs.com/package/@nextcloud/notify_push)

@@ -5,0 +5,0 @@ A javascript client for notify_push events for Nextcloud apps.