Files
habitica/website/server/models/pushDevice.js
Matteo Pagliazzi 08d7727881 Push notifications (#7682)
* Fix Social Push notifications

* Fix code formatting issues

* Fix commented issues

* Fix Syntax errors

* update push notify dependency

* specify push-notify version

* change how apn key is loaded

* feat(push-notifications): improve logging

* feat(push-notifications): disable v2 push notifications

* test(push-notifications): add unit tests and improve integration ones

* fix(push-notifications): throw when required params are missing

* fix(tests): correct descriptions and remove wrong comment

* fix(push-notifications): trim APN key

* fix(apn): log feedback only if it has data

* fix(apn): load cert and key differently

* fix(tests): correctly load apn during tests

* download creds from S3 and create AWS lib

* convert s3 buffer to a string

* fix(apn): remove console.log and do not use cert twice

* invert key and cert, disable failing test

* invert key and cert
2016-06-23 00:19:37 +02:00

22 lines
499 B
JavaScript

import mongoose from 'mongoose';
import baseModel from '../libs/api-v3/baseModel';
const Schema = mongoose.Schema;
export let schema = new Schema({
regId: {type: String, required: true},
type: {type: String, required: true, enum: ['ios', 'android']},
}, {
strict: true,
minimize: false, // So empty objects are returned
_id: false,
});
schema.plugin(baseModel, {
noSet: ['_id', 'regId'],
timestamps: true,
_id: false,
});
export let model = mongoose.model('PushDevice', schema);