UNPKG

@topoos/push

Version:

SDK para el servicio de envío de notificaciones mediante Firebase Cloud Messaging, desarrollado en NodeJS.

187 lines (149 loc) 8.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _ApiClient = _interopRequireDefault(require("../ApiClient")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * The Notification model module. * @module org.wso2.client.model.PUSH/Notification * @version 1.0.0 */ var Notification = /*#__PURE__*/function () { /** * Constructs a new <code>Notification</code>. * Carga útil de la notificación * @alias module:org.wso2.client.model.PUSH/Notification */ function Notification() { _classCallCheck(this, Notification); Notification.initialize(this); } /** * Initializes the fields of this object. * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). * Only for internal use. */ _createClass(Notification, null, [{ key: "initialize", value: function initialize(obj) {} /** * Constructs a <code>Notification</code> from a plain JavaScript object, optionally creating a new instance. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. * @param {Object} data The plain JavaScript object bearing properties of interest. * @param {module:org.wso2.client.model.PUSH/Notification} obj Optional instance to populate. * @return {module:org.wso2.client.model.PUSH/Notification} The populated <code>Notification</code> instance. */ }, { key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new Notification(); if (data.hasOwnProperty('title')) { obj['title'] = _ApiClient["default"].convertToType(data['title'], 'String'); } if (data.hasOwnProperty('body')) { obj['body'] = _ApiClient["default"].convertToType(data['body'], 'String'); } if (data.hasOwnProperty('icon')) { obj['icon'] = _ApiClient["default"].convertToType(data['icon'], 'String'); } if (data.hasOwnProperty('sound')) { obj['sound'] = _ApiClient["default"].convertToType(data['sound'], 'String'); } if (data.hasOwnProperty('tag')) { obj['tag'] = _ApiClient["default"].convertToType(data['tag'], 'String'); } if (data.hasOwnProperty('color')) { obj['color'] = _ApiClient["default"].convertToType(data['color'], 'String'); } if (data.hasOwnProperty('clickAction')) { obj['clickAction'] = _ApiClient["default"].convertToType(data['clickAction'], 'String'); } if (data.hasOwnProperty('badge')) { obj['badge'] = _ApiClient["default"].convertToType(data['badge'], 'String'); } if (data.hasOwnProperty('bodyLocKey')) { obj['bodyLocKey'] = _ApiClient["default"].convertToType(data['bodyLocKey'], 'String'); } if (data.hasOwnProperty('bodyLocArgs')) { obj['bodyLocArgs'] = _ApiClient["default"].convertToType(data['bodyLocArgs'], 'String'); } if (data.hasOwnProperty('titleLocKey')) { obj['titleLocKey'] = _ApiClient["default"].convertToType(data['titleLocKey'], 'String'); } if (data.hasOwnProperty('titleLocArgs')) { obj['titleLocArgs'] = _ApiClient["default"].convertToType(data['titleLocArgs'], 'String'); } } return obj; } }]); return Notification; }(); /** * El título de la notificación. Este campo no es visible en tablets y teléfonos con iOS * @member {String} title */ Notification.prototype['title'] = undefined; /** * El texto del cuerpo de la notificación * @member {String} body */ Notification.prototype['body'] = undefined; /** * El ícono de la notificación. Se corresponde con el nombre de recurso de la carpeta drawable. Si no envías esta clave en la solicitud, FCM muestra el ícono de Launcher que se especifica en el manifiesto de la app * @member {String} icon */ Notification.prototype['icon'] = undefined; /** * El sonido que se reproduce cuando el dispositivo recibe la notificación. Android: Admite \"default\" o el nombre de archivo de un recurso de sonido incluido en la app. Los archivos de sonido deben alojarse en /res/raw/. iOS: Los archivos de sonido pueden estar dentro del paquete principal de la app cliente o en la carpeta Library/Sounds del contenedor de datos de la app * @member {String} sound */ Notification.prototype['sound'] = undefined; /** * Identificador que se usa para reemplazar las notificaciones existentes en el panel de notificaciones. Si no se configura, cada solicitud crea una nueva notificación. Si se especifica y ya se muestra una notificación con la misma etiqueta, la notificación nueva reemplaza la existente en el panel de notificaciones * @member {String} tag */ Notification.prototype['tag'] = undefined; /** * El color del ícono de la notificación, expresado en formato #rrggbb. * @member {String} color */ Notification.prototype['color'] = undefined; /** * La acción asociada con el clic de un usuario en la notificación. Android: Si se especifica, se lanza una actividad con un Intent Filter que coinciden cuando un usuario hace clic en la notificación. iOS: Corresponde a category en la carga útil de APNS * @member {String} clickAction */ Notification.prototype['clickAction'] = undefined; /** * El valor de la insignia en el ícono de la app de la pantalla principal. Si no se especifica, la insignia no se cambia. Si se le asigna el valor 0, la insignia se quita. * @member {String} badge */ Notification.prototype['badge'] = undefined; /** * La clave string del cuerpo en los recursos de string de la app que se usa para localizar el texto del cuerpo en la localización actual del usuario. iOS: Corresponde a loc-key en el payload APNS. Android: nombre del recurso * @member {String} bodyLocKey */ Notification.prototype['bodyLocKey'] = undefined; /** * Valores string variables que se usarán en lugar de los especificadores de formato en bodyLocKey para localizar el cuerpo del texto en la localización actual del usuario. iOS: Corresponde a loc-args en el payload APNS. Android: Array de elementos a sustituir a los argumentos del tipo %1$s, %2$d... El valor debe ser un array, resultado de una operación JSON.Stringify * @member {String} bodyLocArgs */ Notification.prototype['bodyLocArgs'] = undefined; /** * La clave string del título en los recursos de string de la app que se usa para localizar el texto del título en la localización actual del usuario. iOS: Corresponde a title-loc-key en el payload APNS. Android: nombre del recurso * @member {String} titleLocKey */ Notification.prototype['titleLocKey'] = undefined; /** * Valores string variables que se usarán en lugar de los especificadores de formato en titleLocKey para localizar el título del texto en la localización actual del usuario. iOS: Corresponde a title-loc-args en el payload APNS. Android: Array de elementos a sustituir a los argumentos del tipo %1$s, %2$d... El valor debe ser un array, resultado de una operación JSON.Stringify * @member {String} titleLocArgs */ Notification.prototype['titleLocArgs'] = undefined; var _default = Notification; exports["default"] = _default;