forked from synzen/MonitoRSS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
80 lines (74 loc) · 3.25 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
const connectDb = require('./src/util/connectDatabase.js')
const initialize = require('./src/initialization/index.js')
const config = require('./src/config.js')
// Models
exports.models = {
Article: require('./src/models/Article.js'),
Blacklist: require('./src/models/Blacklist.js'),
DeliveryRecord: require('./src/models/DeliveryRecord.js'),
FailRecord: require('./src/models/FailRecord.js'),
Feed: require('./src/models/Feed.js'),
Feedback: require('./src/models/Feedback.js'),
FilteredFormat: require('./src/models/FilteredFormat.js'),
GeneralStats: require('./src/models/GeneralStats.js'),
KeyValue: require('./src/models/KeyValue.js'),
Patron: require('./src/models/Patron.js'),
Profile: require('./src/models/Profile.js'),
Rating: require('./src/models/Rating.js'),
Schedule: require('./src/models/Schedule.js'),
ScheduleStats: require('./src/models/ScheduleStats.js'),
Subscriber: require('./src/models/Subscriber.js'),
Supporter: require('./src/models/Supporter.js')
}
// Structures
exports.Article = require('./src/structs/Article.js')
exports.ArticleMessage = require('./src/structs/ArticleMessage.js')
exports.ArticleMessageRateLimiter = require('./src/structs/ArticleMessageRateLimiter')
exports.ArticleTestMessage = require('./src/structs/ArticleTestMessage.js')
exports.Client = require('./src/structs/Client.js')
exports.ClientManager = require('./src/structs/ClientManager.js')
exports.FeedData = require('./src/structs/FeedData.js')
exports.Guild = require('./src/structs/Guild.js')
exports.GuildData = require('./src/structs/GuildData.js')
exports.Translator = require('./src/structs/Translator.js')
exports.DeliveryPipeline = require('./src/structs/DeliveryPipeline.js')
// Database Structures
exports.Blacklist = require('./src/structs/db/Blacklist.js')
exports.FailRecord = require('./src/structs/db/FailRecord.js')
exports.Feed = require('./src/structs/db/Feed.js')
exports.FilteredFormat = require('./src/structs/db/FilteredFormat.js')
exports.KeyValue = require('./src/structs/db/KeyValue.js')
exports.Patron = require('./src/structs/db/Patron.js')
exports.Profile = require('./src/structs/db/Profile.js')
exports.Schedule = require('./src/structs/db/Schedule.js')
exports.ScheduleStats = require('./src/structs/db/ScheduleStats.js')
exports.Subscriber = require('./src/structs/db/Subscriber.js')
exports.Supporter = require('./src/structs/db/Supporter.js')
// Utils
exports.FeedFetcher = require('./src/util/FeedFetcher.js')
exports.validateConfig = require('./src/util/config/schema').validate
exports.config = config
exports.schemas = require('./src/util/config/schema.js').schemas
exports.scripts = {
runSchedule: require('./scripts/scheduleRun.js')
}
exports.migrations = {
v6: require('./scripts/pre_v6.js')
}
// Errors
exports.errors = {
FeedParserError: require('./src/structs/errors/FeedParserError.js'),
RequestError: require('./src/structs/errors/RequestError.js'),
BadRequestError: require('./src/structs/errors/http/BadRequestError')
}
/**
* Necessary for npm modules to use models that
* depends on the database being connected
*
* @param {string} uri
* @param {Object<string, any>} options
*/
exports.setupModels = async (uri, options) => {
const connection = await connectDb(uri, options)
await initialize.setupModels(connection)
}