-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from starshipapp/main
Pull 0.9 into stable branch
- Loading branch information
Showing
71 changed files
with
7,220 additions
and
2,734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Document, model, Schema } from "mongoose"; | ||
import nanoIdPlugin from "mongoose-nanoid"; | ||
|
||
export interface IAttachment extends Document { | ||
/** The attachment's ID. */ | ||
_id: string, | ||
/** The attachment's filename. */ | ||
name: string, | ||
/** The attachment's content type. */ | ||
type: string, | ||
/** The attachment's URL. */ | ||
url: string | ||
} | ||
|
||
const attachmentSchema: Schema = new Schema({ | ||
_id: String, | ||
name: String, | ||
type: String, | ||
url: String, | ||
}); | ||
|
||
attachmentSchema.plugin(nanoIdPlugin, 16); | ||
|
||
export default model<IAttachment>('attachments', attachmentSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {model, Schema, Document} from "mongoose"; | ||
import nanoIdPlugin from "mongoose-nanoid"; | ||
|
||
export interface ICustomEmoji extends Document { | ||
/** The emoji's ID. */ | ||
_id: string, | ||
/** The ID of the owner of the emoji. */ | ||
owner: string, | ||
/** The planet the emoji is from, if it is a planet emoji. */ | ||
planet: string, | ||
/** The user the emoji is from, if it is a user emoji. */ | ||
user: string, | ||
/** The name of the emoji. */ | ||
name: string, | ||
/** The URL of the emoji. */ | ||
url: string | ||
} | ||
|
||
const customEmojiSchema: Schema = new Schema({ | ||
_id: String, | ||
owner: String, | ||
planet: String, | ||
user: String, | ||
name: String, | ||
url: String | ||
}); | ||
|
||
customEmojiSchema.plugin(nanoIdPlugin, 16); | ||
|
||
export default model<ICustomEmoji>('customemojis', customEmojiSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {model, Schema, Document} from "mongoose"; | ||
import nanoIdPlugin from "mongoose-nanoid"; | ||
|
||
export interface INotification extends Document { | ||
/** The notification's ID. */ | ||
_id: string, | ||
/** The ID of the recipient. */ | ||
user: string, | ||
/** The creation date of the notification. */ | ||
createdAt: Date, | ||
/** The notification's icon. */ | ||
icon: string, | ||
/** The content of the notification. */ | ||
text: string, | ||
/** Whether or not the notification is read. */ | ||
isRead: boolean | ||
} | ||
|
||
const notificationSchema: Schema = new Schema({ | ||
_id: String, | ||
user: String, | ||
createdAt: {type: Date, expires: 15780000, default: Date.now()}, | ||
icon: String, | ||
text: String, | ||
isRead: {type: Boolean, default: false} | ||
}); | ||
|
||
notificationSchema.plugin(nanoIdPlugin, 16); | ||
|
||
export default model<INotification>('notifications', notificationSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Document, model, Schema } from "mongoose"; | ||
import nanoIdPlugin from "mongoose-nanoid"; | ||
|
||
export interface IReadReceipt extends Document { | ||
_id: string, | ||
planet: string, | ||
user: string, | ||
lastRead: [{channelId: string, date: Date}] | ||
} | ||
|
||
const readReceiptSchema: Schema = new Schema({ | ||
_id: String, | ||
user: String, | ||
planet: String, | ||
lastRead: [{channelId: String, date: Date}] | ||
}); | ||
|
||
readReceiptSchema.plugin(nanoIdPlugin, 16); | ||
|
||
export default model<IReadReceipt>('readreceipts', readReceiptSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.