This repository has been archived on 2025-12-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
qmi-cloud/qmi-cloud-common/models/Webhook.js
Manuel Romero 729cfe4980 payload log
2025-01-14 11:58:51 +01:00

50 lines
974 B
JavaScript

const mongoose = require('mongoose');
const { scenario } = require('../mongo');
const schema = new mongoose.Schema({
created: {
type: Date,
default: Date.now,
index : true
},
name: {
type: String
},
owner: {
type: mongoose.Types.ObjectId,
ref: 'User'
},
eventType: {
type: String // provision.finished, provision.error, provision.destroyed-finished, provision.destroy-error
},
scenario: {
type: String // scenario name
},
url: {
type: String
},
headers: {
type: Object,
default: {}
},
queryparams: {
type: Object
},
isEnabled: {
type: Boolean,
default: true
},
lastExecTs: {
type: Date,
default: Date.now
},
lastExecResult: {
type: String
},
lastExecPayload: {
type: String
}
});
module.exports = mongoose.model('Webhook', schema)