|
|
@@ -1,5 +1,10 @@
|
|
|
const crypto = require('crypto');
|
|
|
+const mongoose = require('mongoose');
|
|
|
|
|
|
+const schema = new mongoose.Schema({
|
|
|
+ tokenGtoP: { type: String, required: true, unique: true },
|
|
|
+ tokenPtoG: { type: String, required: true, unique: true },
|
|
|
+});
|
|
|
class SlackAppIntegration {
|
|
|
|
|
|
static generateAccessToken(user) {
|
|
|
@@ -13,12 +18,5 @@ class SlackAppIntegration {
|
|
|
}
|
|
|
|
|
|
module.exports = function(crowi) {
|
|
|
- const mongoose = require('mongoose');
|
|
|
-
|
|
|
- const slackAppIntegrationSchema = new mongoose.Schema({
|
|
|
- tokenGtoP: { type: String, required: true, unique: true },
|
|
|
- tokenPtoG: { type: String, required: true, unique: true },
|
|
|
- });
|
|
|
-
|
|
|
- return mongoose.model('SlackAppIntegration', slackAppIntegrationSchema);
|
|
|
+ return mongoose.model('SlackAppIntegration', schema);
|
|
|
};
|