1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 13:14:06 +01:00

🎨 remove _id and __v from response

This commit is contained in:
Flam3rboy 2021-04-06 22:06:53 +02:00
parent 41e7268947
commit 7d9cc0efbf
15 changed files with 178 additions and 99 deletions

24
dist/index.d.ts vendored
View File

@ -1,27 +1,7 @@
export * from "./util/checkToken"; export * from "./util/checkToken";
export * as Constants from "./util/Constants"; export * as Constants from "./util/Constants";
export * from "./models/Ban"; export * from "./models/index";
export * from "./models/Channel"; export * from "./util/index";
export * from "./models/Emoji";
export * from "./models/Guild";
export * from "./models/Invite";
export * from "./models/Member";
export * from "./models/Role";
export * from "./models/User";
export * from "./models/Activity";
export * from "./models/Application";
export * from "./models/Interaction";
export * from "./models/Message";
export * from "./models/Status";
export * from "./models/VoiceState";
export * from "./util/String";
export * from "./util/BitField";
export * from "./util/Intents";
export * from "./util/MessageFlags";
export * from "./util/Permissions";
export * from "./util/Snowflake";
export * from "./util/UserFlags";
export * from "./models/Event";
import Config, { DefaultOptions } from "./util/Config"; import Config, { DefaultOptions } from "./util/Config";
import db, { MongooseCache } from "./util/Database"; import db, { MongooseCache } from "./util/Database";
export { Config, db, DefaultOptions, MongooseCache }; export { Config, db, DefaultOptions, MongooseCache };

24
dist/index.js vendored
View File

@ -25,28 +25,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.MongooseCache = exports.DefaultOptions = exports.db = exports.Config = exports.Constants = void 0; exports.MongooseCache = exports.DefaultOptions = exports.db = exports.Config = exports.Constants = void 0;
__exportStar(require("./util/checkToken"), exports); __exportStar(require("./util/checkToken"), exports);
exports.Constants = __importStar(require("./util/Constants")); exports.Constants = __importStar(require("./util/Constants"));
__exportStar(require("./models/Ban"), exports); __exportStar(require("./models/index"), exports);
__exportStar(require("./models/Channel"), exports); __exportStar(require("./util/index"), exports);
__exportStar(require("./models/Emoji"), exports);
__exportStar(require("./models/Guild"), exports);
__exportStar(require("./models/Invite"), exports);
__exportStar(require("./models/Member"), exports);
__exportStar(require("./models/Role"), exports);
__exportStar(require("./models/User"), exports);
__exportStar(require("./models/Activity"), exports);
__exportStar(require("./models/Application"), exports);
__exportStar(require("./models/Interaction"), exports);
__exportStar(require("./models/Message"), exports);
__exportStar(require("./models/Status"), exports);
__exportStar(require("./models/VoiceState"), exports);
__exportStar(require("./util/String"), exports);
__exportStar(require("./util/BitField"), exports);
__exportStar(require("./util/Intents"), exports);
__exportStar(require("./util/MessageFlags"), exports);
__exportStar(require("./util/Permissions"), exports);
__exportStar(require("./util/Snowflake"), exports);
__exportStar(require("./util/UserFlags"), exports);
__exportStar(require("./models/Event"), exports);
const Config_1 = __importStar(require("./util/Config")); const Config_1 = __importStar(require("./util/Config"));
exports.Config = Config_1.default; exports.Config = Config_1.default;
Object.defineProperty(exports, "DefaultOptions", { enumerable: true, get: function () { return Config_1.DefaultOptions; } }); Object.defineProperty(exports, "DefaultOptions", { enumerable: true, get: function () { return Config_1.DefaultOptions; } });

2
dist/index.js.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAElC,8DAA8C;AAC9C,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,iDAA+B;AAC/B,kDAAgC;AAChC,kDAAgC;AAChC,gDAA8B;AAC9B,gDAA8B;AAC9B,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC;AACrC,mDAAiC;AACjC,kDAAgC;AAChC,sDAAoC;AAEpC,gDAA8B;AAC9B,kDAAgC;AAChC,iDAA+B;AAC/B,sDAAoC;AACpC,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAE/B,wDAAuD;AAG9C,iBAHF,gBAAM,CAGE;AAAM,+FAHJ,uBAAc,OAGI;AAFnC,4DAAoD;AAEnC,aAFV,kBAAE,CAEU;AAAkB,8FAFxB,wBAAa,OAEwB"} {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAElC,8DAA8C;AAC9C,iDAA+B;AAC/B,+CAA6B;AAE7B,wDAAuD;AAG9C,iBAHF,gBAAM,CAGE;AAAM,+FAHJ,uBAAc,OAGI;AAFnC,4DAAoD;AAEnC,aAFV,kBAAE,CAEU;AAAkB,8FAFxB,wBAAa,OAEwB"}

View File

@ -117,6 +117,14 @@ exports.MessageSchema = new mongoose_1.Schema({
channel_id: String, channel_id: String,
guild_id: String, guild_id: String,
}, },
}, {
toJSON: {
transform: function (doc, ret) {
delete ret.mention_channel_ids;
delete ret.mention_user_ids;
delete ret.mention_role_ids;
},
},
}); });
exports.MessageSchema.virtual("author", { exports.MessageSchema.virtual("author", {
ref: User_1.UserModel, ref: User_1.UserModel,

View File

@ -1 +1 @@
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAmD;AACnD,gEAAkC;AAClC,iCAAmC;AACnC,qCAAuC;AACvC,iCAAmC;AAwCnC,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACtB,mDAAW,CAAA;IACX,+DAAiB,CAAA;IACjB,qEAAoB,CAAA;IACpB,6CAAQ,CAAA;IACR,2EAAuB,CAAA;IACvB,2EAAuB,CAAA;IACvB,iFAA0B,CAAA;IAC1B,uEAAqB,CAAA;IACrB,mGAAmC,CAAA;IACnC,iHAA0C,CAAA;IAC1C,kHAA2C,CAAA;IAC3C,kHAA2C,CAAA;IAC3C,0EAAuB,CAAA;IACvB,8FAAiC,CAAA;IACjC,4FAAgC,CAAA;IAChC,gDAAU,CAAA;IACV,4EAAwB,CAAA;AACzB,CAAC,EAlBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAkBtB;AAsEY,QAAA,UAAU,GAAG;IACzB,EAAE,EAAE,MAAM;IACV,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,MAAM;IACZ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kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,eAAe,EAAE;IACtC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,kBAAkB;IAC9B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,qBAAa,CAAC,OAAO,CAAC,kBAAkB,EAAE;IACzC,GAAG,EAAE,gBAAS;IACd,UAAU,EAAE,qBAAqB;IACjC,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,kCAAkC;AAClC,yCAAyC;AACzC,qBAAqB;AACrB,mCAAmC;AACnC,uBAAuB;AACvB,kBAAkB;AAClB,MAAM;AAEN,aAAa;AACA,QAAA,YAAY,GAAG,kBAAE,CAAC,KAAK,CAAkB,SAAS,EAAE,qBAAa,EAAE,UAAU,CAAC,CAAC"}

15
dist/models/index.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
export * from "./Ban";
export * from "./Channel";
export * from "./Emoji";
export * from "./Guild";
export * from "./Invite";
export * from "./Member";
export * from "./Role";
export * from "./User";
export * from "./Activity";
export * from "./Application";
export * from "./Interaction";
export * from "./Message";
export * from "./Status";
export * from "./VoiceState";
export * from "./Event";

42
dist/models/index.js vendored Normal file
View File

@ -0,0 +1,42 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const mongoose_1 = __importDefault(require("mongoose"));
__exportStar(require("./Ban"), exports);
__exportStar(require("./Channel"), exports);
__exportStar(require("./Emoji"), exports);
__exportStar(require("./Guild"), exports);
__exportStar(require("./Invite"), exports);
__exportStar(require("./Member"), exports);
__exportStar(require("./Role"), exports);
__exportStar(require("./User"), exports);
__exportStar(require("./Activity"), exports);
__exportStar(require("./Application"), exports);
__exportStar(require("./Interaction"), exports);
__exportStar(require("./Message"), exports);
__exportStar(require("./Status"), exports);
__exportStar(require("./VoiceState"), exports);
__exportStar(require("./Event"), exports);
mongoose_1.default.plugin((schema) => {
schema.options.toJSON = {
virtuals: true,
versionKey: false,
transform(doc, ret) {
delete ret._id;
delete ret.__v;
},
};
});
//# sourceMappingURL=index.js.map

1
dist/models/index.js.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAAgC;AAEhC,wCAAsB;AACtB,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,6CAA2B;AAC3B,gDAA8B;AAC9B,gDAA8B;AAC9B,4CAA0B;AAC1B,2CAAyB;AACzB,+CAA6B;AAC7B,0CAAwB;AAExB,kBAAQ,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE;IAC/B,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG;QACvB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,KAAK;QACjB,SAAS,CAAC,GAAQ,EAAE,GAAQ;YAC3B,OAAO,GAAG,CAAC,GAAG,CAAC;YACf,OAAO,GAAG,CAAC,GAAG,CAAC;QAChB,CAAC;KACD,CAAC;AACH,CAAC,CAAC,CAAC"}

7
dist/util/index.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
export * from "./String";
export * from "./BitField";
export * from "./Intents";
export * from "./MessageFlags";
export * from "./Permissions";
export * from "./Snowflake";
export * from "./UserFlags";

20
dist/util/index.js vendored Normal file
View File

@ -0,0 +1,20 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./String"), exports);
__exportStar(require("./BitField"), exports);
__exportStar(require("./Intents"), exports);
__exportStar(require("./MessageFlags"), exports);
__exportStar(require("./Permissions"), exports);
__exportStar(require("./Snowflake"), exports);
__exportStar(require("./UserFlags"), exports);
//# sourceMappingURL=index.js.map

1
dist/util/index.js.map vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,4CAA0B;AAC1B,iDAA+B;AAC/B,gDAA8B;AAC9B,8CAA4B;AAC5B,8CAA4B"}

View File

@ -1,29 +1,8 @@
export * from "./util/checkToken"; export * from "./util/checkToken";
export * as Constants from "./util/Constants"; export * as Constants from "./util/Constants";
export * from "./models/Ban"; export * from "./models/index";
export * from "./models/Channel"; export * from "./util/index";
export * from "./models/Emoji";
export * from "./models/Guild";
export * from "./models/Invite";
export * from "./models/Member";
export * from "./models/Role";
export * from "./models/User";
export * from "./models/Activity";
export * from "./models/Application";
export * from "./models/Interaction";
export * from "./models/Message";
export * from "./models/Status";
export * from "./models/VoiceState";
export * from "./util/String";
export * from "./util/BitField";
export * from "./util/Intents";
export * from "./util/MessageFlags";
export * from "./util/Permissions";
export * from "./util/Snowflake";
export * from "./util/UserFlags";
export * from "./models/Event";
import Config, { DefaultOptions } from "./util/Config"; import Config, { DefaultOptions } from "./util/Config";
import db, { MongooseCache } from "./util/Database"; import db, { MongooseCache } from "./util/Database";

View File

@ -190,39 +190,50 @@ export const Embed = {
], ],
}; };
export const MessageSchema = new Schema({ export const MessageSchema = new Schema(
id: String, {
channel_id: String, id: String,
author_id: String,
webhook_id: String,
guild_id: String,
application_id: String,
content: String,
timestamp: Date,
edited_timestamp: Date,
tts: Boolean,
mention_everyone: Boolean,
mention_user_ids: [String],
mention_role_ids: [String],
mention_channel_ids: [String],
attachments: [Attachment],
embeds: [Embed],
reactions: [Reaction],
nonce: Schema.Types.Mixed, // can be a long or a string
pinned: Boolean,
type: { type: Number },
activity: {
type: Number,
party_id: String,
},
flags: Types.Long,
stickers: [],
message_reference: {
message_id: String,
channel_id: String, channel_id: String,
author_id: String,
webhook_id: String,
guild_id: String, guild_id: String,
application_id: String,
content: String,
timestamp: Date,
edited_timestamp: Date,
tts: Boolean,
mention_everyone: Boolean,
mention_user_ids: [String],
mention_role_ids: [String],
mention_channel_ids: [String],
attachments: [Attachment],
embeds: [Embed],
reactions: [Reaction],
nonce: Schema.Types.Mixed, // can be a long or a string
pinned: Boolean,
type: { type: Number },
activity: {
type: Number,
party_id: String,
},
flags: Types.Long,
stickers: [],
message_reference: {
message_id: String,
channel_id: String,
guild_id: String,
},
}, },
}); {
toJSON: {
transform: function (doc, ret) {
delete ret.mention_channel_ids;
delete ret.mention_user_ids;
delete ret.mention_role_ids;
},
},
}
);
MessageSchema.virtual("author", { MessageSchema.virtual("author", {
ref: UserModel, ref: UserModel,

28
src/models/index.ts Normal file
View File

@ -0,0 +1,28 @@
import mongoose from "mongoose";
export * from "./Ban";
export * from "./Channel";
export * from "./Emoji";
export * from "./Guild";
export * from "./Invite";
export * from "./Member";
export * from "./Role";
export * from "./User";
export * from "./Activity";
export * from "./Application";
export * from "./Interaction";
export * from "./Message";
export * from "./Status";
export * from "./VoiceState";
export * from "./Event";
mongoose.plugin((schema: any) => {
schema.options.toJSON = {
virtuals: true,
versionKey: false,
transform(doc: any, ret: any) {
delete ret._id;
delete ret.__v;
},
};
});

7
src/util/index.ts Normal file
View File

@ -0,0 +1,7 @@
export * from "./String";
export * from "./BitField";
export * from "./Intents";
export * from "./MessageFlags";
export * from "./Permissions";
export * from "./Snowflake";
export * from "./UserFlags";