返回提交历史
Modified
.eslintrc
+1
-1
Modified
package-lock.json
+4
-4
Modified
package.json
+1
-1
Modified
src/controllers/api/crewShipFusionController.ts
+0
-1
Modified
src/controllers/dynamic/getProfileViewingDataController.ts
+1
-1
Modified
src/models/inboxModel.ts
+1
-1
Modified
src/models/inventoryModels/inventoryModel.ts
+31
-31
Modified
src/models/inventoryModels/loadoutModel.ts
+2
-2
Modified
src/models/loginModel.ts
+1
-1
Modified
src/models/personalRoomsModel.ts
+4
-4
Modified
src/models/shipModel.ts
+1
-1
Modified
src/models/statsModel.ts
+1
-1
Modified
src/services/configService.ts
+1
-1
Modified
src/types/inventoryTypes/inventoryTypes.ts
+0
-1
XFEstudio/XFESpaceNinjaServer
chore: update mongoose (#2539)
The transform hook signature was changed in the typings, so I just updated them to be explicit about what we expect. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2539 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
aada031a
代码差异
14 个文件
+49
-51
@@ -21,7 +21,7 @@
21
21
"@typescript-eslint/no-unsafe-argument": "error",
22
22
"@typescript-eslint/no-unsafe-call": "error",
23
23
"@typescript-eslint/no-unsafe-assignment": "error",
24
"@typescript-eslint/no-explicit-any": "error",
24
"@typescript-eslint/no-explicit-any": "off",
25
25
"no-loss-of-precision": "error",
26
26
"@typescript-eslint/no-unnecessary-condition": "error",
27
27
"@typescript-eslint/no-base-to-string": "off",
@@ -18,7 +18,7 @@
18
18
"crc-32": "^1.2.2",
19
19
"express": "^5",
20
20
"json-with-bigint": "^3.4.4",
21
"mongoose": ">=8.11.0 <8.16.2",
21
"mongoose": "^8.11.0",
22
22
"morgan": "^1.10.0",
23
23
"ncp": "^2.0.0",
24
24
"typescript": "^5.5",
@@ -3889,9 +3889,9 @@
3889
3889
}
3890
3890
},
3891
3891
"node_modules/mongoose": {
3892
"version": "8.16.1",
3893
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.16.1.tgz",
3894
"integrity": "sha512-Q+0TC+KLdY4SYE+u9gk9pdW1tWu/pl0jusyEkMGTgBoAbvwQdfy4f9IM8dmvCwb/blSfp7IfLkob7v76x6ZGpQ==",
3892
"version": "8.16.4",
3893
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.16.4.tgz",
3894
"integrity": "sha512-jslgdQ8pY2vcNSKPv3Dbi5ogo/NT8zcvf6kPDyD8Sdsjsa1at3AFAF0F5PT+jySPGSPbvlNaQ49nT9h+Kx2UDA==",
3895
3895
"license": "MIT",
3896
3896
"dependencies": {
3897
3897
"bson": "^6.10.4",
@@ -35,7 +35,7 @@
35
35
"crc-32": "^1.2.2",
36
36
"express": "^5",
37
37
"json-with-bigint": "^3.4.4",
38
"mongoose": ">=8.11.0 <8.16.2",
38
"mongoose": "^8.11.0",
39
39
"morgan": "^1.10.0",
40
40
"ncp": "^2.0.0",
41
41
"typescript": "^5.5",
@@ -88,7 +88,6 @@ export const crewShipFusionController: RequestHandler = async (req, res) => {
88
88
}
89
89
}
90
90
superiorItem.UpgradeFingerprint = JSON.stringify(fingerprint);
91
// eslint-disable-next-line @typescript-eslint/no-explicit-any
92
91
inventoryChanges[category] = [superiorItem.toJSON() as any];
93
92
94
93
await inventory.save();
@@ -141,7 +141,7 @@ export const getProfileViewingDataGetController: RequestHandler = async (req, re
141
141
}
142
142
}
143
143
} else {
144
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
144
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
145
145
combinedStats[arrayName].push(entry as any);
146
146
}
147
147
}
@@ -150,7 +150,7 @@ messageSchema.virtual("messageId").get(function (this: IMessageDatabase) {
150
150
151
151
messageSchema.set("toJSON", {
152
152
virtuals: true,
153
transform(_document, returnedObject) {
153
transform(_document, returnedObject: Record<string, any>) {
154
154
const messageDatabase = returnedObject as IMessageDatabase;
155
155
const messageClient = returnedObject as IMessageClient;
156
156
@@ -121,7 +121,7 @@ import {
121
121
export const typeCountSchema = new Schema<ITypeCount>({ ItemType: String, ItemCount: Number }, { _id: false });
122
122
123
123
typeCountSchema.set("toJSON", {
124
transform(_doc, obj) {
124
transform(_doc, obj: Record<string, any>) {
125
125
if (obj.ItemCount > 2147483647) {
126
126
obj.ItemCount = 2147483647;
127
127
} else if (obj.ItemCount < -2147483648) {
@@ -189,7 +189,7 @@ operatorConfigSchema.virtual("ItemId").get(function () {
189
189
190
190
operatorConfigSchema.set("toJSON", {
191
191
virtuals: true,
192
transform(_document, returnedObject) {
192
transform(_document, returnedObject: Record<string, any>) {
193
193
delete returnedObject._id;
194
194
delete returnedObject.__v;
195
195
}
@@ -226,7 +226,7 @@ const ItemConfigSchema = new Schema<IItemConfig>(
226
226
);
227
227
228
228
ItemConfigSchema.set("toJSON", {
229
transform(_document, returnedObject) {
229
transform(_document, returnedObject: Record<string, any>) {
230
230
delete returnedObject.__v;
231
231
}
232
232
});
@@ -261,7 +261,7 @@ RawUpgrades.virtual("LastAdded").get(function () {
261
261
262
262
RawUpgrades.set("toJSON", {
263
263
virtuals: true,
264
transform(_document, returnedObject) {
264
transform(_document, returnedObject: Record<string, any>) {
265
265
delete returnedObject._id;
266
266
delete returnedObject.__v;
267
267
}
@@ -282,7 +282,7 @@ upgradeSchema.virtual("ItemId").get(function () {
282
282
283
283
upgradeSchema.set("toJSON", {
284
284
virtuals: true,
285
transform(_document, returnedObject) {
285
transform(_document, returnedObject: Record<string, any>) {
286
286
delete returnedObject._id;
287
287
delete returnedObject.__v;
288
288
}
@@ -325,7 +325,7 @@ const crewMemberSchema = new Schema<ICrewMemberDatabase>(
325
325
326
326
crewMemberSchema.set("toJSON", {
327
327
virtuals: true,
328
transform(_doc, obj) {
328
transform(_doc, obj: Record<string, any>) {
329
329
const db = obj as ICrewMemberDatabase;
330
330
const client = obj as ICrewMemberClient;
331
331
@@ -353,7 +353,7 @@ const FlavourItemSchema = new Schema(
353
353
);
354
354
355
355
FlavourItemSchema.set("toJSON", {
356
transform(_document, returnedObject) {
356
transform(_document, returnedObject: Record<string, any>) {
357
357
delete returnedObject._id;
358
358
delete returnedObject.__v;
359
359
}
@@ -367,7 +367,7 @@ FlavourItemSchema.set("toJSON", {
367
367
);
368
368
369
369
MailboxSchema.set("toJSON", {
370
transform(_document, returnedObject) {
370
transform(_document, returnedObject: Record<string, any>) {
371
371
const mailboxDatabase = returnedObject as HydratedDocument<IMailboxDatabase, { __v?: number }>;
372
372
delete mailboxDatabase.__v;
373
373
(returnedObject as IMailboxClient).LastInboxId = toOid(mailboxDatabase.LastInboxId);
@@ -386,7 +386,7 @@ const DuviriInfoSchema = new Schema<IDuviriInfo>(
386
386
);
387
387
388
388
DuviriInfoSchema.set("toJSON", {
389
transform(_document, returnedObject) {
389
transform(_document, returnedObject: Record<string, any>) {
390
390
delete returnedObject.__v;
391
391
}
392
392
});
@@ -416,7 +416,7 @@ const droneSchema = new Schema<IDroneDatabase>(
416
416
);
417
417
droneSchema.set("toJSON", {
418
418
virtuals: true,
419
transform(_document, obj) {
419
transform(_document, obj: Record<string, any>) {
420
420
const client = obj as IDroneClient;
421
421
const db = obj as IDroneDatabase;
422
422
@@ -457,7 +457,7 @@ const personalGoalProgressSchema = new Schema<IPersonalGoalProgressDatabase>(
457
457
458
458
personalGoalProgressSchema.set("toJSON", {
459
459
virtuals: true,
460
transform(_doc, obj) {
460
transform(_doc, obj: Record<string, any>) {
461
461
const db = obj as IPersonalGoalProgressDatabase;
462
462
const client = obj as IPersonalGoalProgressClient;
463
463
@@ -502,7 +502,7 @@ StepSequencersSchema.virtual("ItemId").get(function () {
502
502
503
503
StepSequencersSchema.set("toJSON", {
504
504
virtuals: true,
505
transform(_document, returnedObject) {
505
transform(_document, returnedObject: Record<string, any>) {
506
506
delete returnedObject._id;
507
507
delete returnedObject.__v;
508
508
}
@@ -516,7 +516,7 @@ const kubrowPetEggSchema = new Schema<IKubrowPetEggDatabase>(
516
516
);
517
517
kubrowPetEggSchema.set("toJSON", {
518
518
virtuals: true,
519
transform(_document, obj) {
519
transform(_document, obj: Record<string, any>) {
520
520
const client = obj as IKubrowPetEggClient;
521
521
const db = obj as IKubrowPetEggDatabase;
522
522
@@ -586,7 +586,7 @@ personalTechProjectSchema.virtual("ItemId").get(function () {
586
586
587
587
personalTechProjectSchema.set("toJSON", {
588
588
virtuals: true,
589
transform(_doc, ret, _options) {
589
transform(_doc, ret: Record<string, any>) {
590
590
delete ret._id;
591
591
delete ret.__v;
592
592
@@ -687,7 +687,7 @@ const questKeysSchema = new Schema<IQuestKeyDatabase>(
687
687
);
688
688
689
689
questKeysSchema.set("toJSON", {
690
transform(_doc, ret, _options) {
690
transform(_doc, ret: Record<string, any>) {
691
691
const questKeysDatabase = ret as IQuestKeyDatabase;
692
692
693
693
if (questKeysDatabase.CompletionDate) {
@@ -709,7 +709,7 @@ const invasionProgressSchema = new Schema<IInvasionProgressDatabase>(
709
709
);
710
710
711
711
invasionProgressSchema.set("toJSON", {
712
transform(_doc, obj) {
712
transform(_doc, obj: Record<string, any>) {
713
713
const db = obj as IInvasionProgressDatabase;
714
714
const client = obj as IInvasionProgressClient;
715
715
@@ -748,7 +748,7 @@ weaponSkinsSchema.virtual("ItemId").get(function () {
748
748
749
749
weaponSkinsSchema.set("toJSON", {
750
750
virtuals: true,
751
transform(_doc, ret, _options) {
751
transform(_doc, ret: Record<string, any>) {
752
752
delete ret._id;
753
753
delete ret.__v;
754
754
}
@@ -772,7 +772,7 @@ const periodicMissionCompletionsSchema = new Schema<IPeriodicMissionCompletionDa
772
772
);
773
773
774
774
periodicMissionCompletionsSchema.set("toJSON", {
775
transform(_doc, ret, _options) {
775
transform(_doc, ret: Record<string, any>) {
776
776
const periodicMissionCompletionDatabase = ret as IPeriodicMissionCompletionDatabase;
777
777
778
778
(periodicMissionCompletionDatabase as unknown as IPeriodicMissionCompletionResponse).date = toMongoDate(
@@ -849,7 +849,7 @@ const endlessXpProgressSchema = new Schema<IEndlessXpProgressDatabase>(
849
849
);
850
850
851
851
endlessXpProgressSchema.set("toJSON", {
852
transform(_doc, ret) {
852
transform(_doc, ret: Record<string, any>) {
853
853
const db = ret as IEndlessXpProgressDatabase;
854
854
const client = ret as IEndlessXpProgressClient;
855
855
@@ -898,7 +898,7 @@ const crewShipMemberSchema = new Schema<ICrewShipMemberDatabase>(
898
898
);
899
899
crewShipMemberSchema.set("toJSON", {
900
900
virtuals: true,
901
transform(_doc, obj) {
901
transform(_doc, obj: Record<string, any>) {
902
902
const db = obj as ICrewShipMemberDatabase;
903
903
const client = obj as ICrewShipMemberClient;
904
904
if (db.ItemId) {
@@ -951,7 +951,7 @@ const dialogueSchema = new Schema<IDialogueDatabase>(
951
951
);
952
952
dialogueSchema.set("toJSON", {
953
953
virtuals: true,
954
transform(_doc, ret) {
954
transform(_doc, ret: Record<string, any>) {
955
955
const db = ret as IDialogueDatabase;
956
956
const client = ret as IDialogueClient;
957
957
@@ -997,7 +997,7 @@ const kubrowPetPrintSchema = new Schema<IKubrowPetPrintDatabase>({
997
997
});
998
998
kubrowPetPrintSchema.set("toJSON", {
999
999
virtuals: true,
1000
transform(_doc, obj) {
1000
transform(_doc, obj: Record<string, any>) {
1001
1001
const db = obj as IKubrowPetPrintDatabase;
1002
1002
const client = obj as IKubrowPetPrintClient;
1003
1003
@@ -1025,7 +1025,7 @@ const detailsSchema = new Schema<IKubrowPetDetailsDatabase>(
1025
1025
);
1026
1026
1027
1027
detailsSchema.set("toJSON", {
1028
transform(_doc, returnedObject) {
1028
transform(_doc, returnedObject: Record<string, any>) {
1029
1029
delete returnedObject.__v;
1030
1030
1031
1031
const db = returnedObject as IKubrowPetDetailsDatabase;
@@ -1081,7 +1081,7 @@ EquipmentSchema.virtual("ItemId").get(function () {
1081
1081
1082
1082
EquipmentSchema.set("toJSON", {
1083
1083
virtuals: true,
1084
transform(_document, returnedObject) {
1084
transform(_document, returnedObject: Record<string, any>) {
1085
1085
delete returnedObject._id;
1086
1086
delete returnedObject.__v;
1087
1087
@@ -1132,7 +1132,7 @@ pendingRecipeSchema.virtual("ItemId").get(function () {
1132
1132
1133
1133
pendingRecipeSchema.set("toJSON", {
1134
1134
virtuals: true,
1135
transform(_document, returnedObject) {
1135
transform(_document, returnedObject: Record<string, any>) {
1136
1136
delete returnedObject._id;
1137
1137
delete returnedObject.__v;
1138
1138
delete returnedObject.LongGuns;
@@ -1170,7 +1170,7 @@ const infestedFoundrySchema = new Schema<IInfestedFoundryDatabase>(
1170
1170
);
1171
1171
1172
1172
infestedFoundrySchema.set("toJSON", {
1173
transform(_doc, ret, _options) {
1173
transform(_doc, ret: Record<string, any>) {
1174
1174
if (ret.AbilityOverrideUnlockCooldown) {
1175
1175
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
1176
1176
ret.AbilityOverrideUnlockCooldown = toMongoDate(ret.AbilityOverrideUnlockCooldown);
@@ -1243,7 +1243,7 @@ const vendorPurchaseHistoryEntrySchema = new Schema<IVendorPurchaseHistoryEntryD
1243
1243
);
1244
1244
1245
1245
vendorPurchaseHistoryEntrySchema.set("toJSON", {
1246
transform(_doc, obj) {
1246
transform(_doc, obj: Record<string, any>) {
1247
1247
const db = obj as IVendorPurchaseHistoryEntryDatabase;
1248
1248
const client = obj as IVendorPurchaseHistoryEntryClient;
1249
1249
client.Expiry = toMongoDate(db.Expiry);
@@ -1286,7 +1286,7 @@ const pendingCouponSchema = new Schema<IPendingCouponDatabase>(
1286
1286
);
1287
1287
1288
1288
pendingCouponSchema.set("toJSON", {
1289
transform(_doc, ret, _options) {
1289
transform(_doc, ret: Record<string, any>) {
1290
1290
(ret as IPendingCouponClient).Expiry = toMongoDate((ret as IPendingCouponDatabase).Expiry);
1291
1291
}
1292
1292
});
@@ -1353,7 +1353,7 @@ const nemesisSchema = new Schema<INemesisDatabase>(
1353
1353
1354
1354
nemesisSchema.set("toJSON", {
1355
1355
virtuals: true,
1356
transform(_doc, obj) {
1356
transform(_doc, obj: Record<string, any>) {
1357
1357
const db = obj as INemesisDatabase;
1358
1358
const client = obj as INemesisClient;
1359
1359
@@ -1383,7 +1383,7 @@ const lastSortieRewardSchema = new Schema<ILastSortieRewardDatabase>(
1383
1383
1384
1384
lastSortieRewardSchema.set("toJSON", {
1385
1385
virtuals: true,
1386
transform(_doc, obj) {
1386
transform(_doc, obj: Record<string, any>) {
1387
1387
const db = obj as ILastSortieRewardDatabase;
1388
1388
const client = obj as ILastSortieRewardClient;
1389
1389
@@ -1790,7 +1790,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
1790
1790
);
1791
1791
1792
1792
inventorySchema.set("toJSON", {
1793
transform(_document, returnedObject) {
1793
transform(_document, returnedObject: Record<string, any>) {
1794
1794
delete returnedObject._id;
1795
1795
delete returnedObject.__v;
1796
1796
delete returnedObject.accountOwnerId;
@@ -49,7 +49,7 @@ loadoutConfigSchema.virtual("ItemId").get(function () {
49
49
50
50
loadoutConfigSchema.set("toJSON", {
51
51
virtuals: true,
52
transform(_doc, ret, _options) {
52
transform(_doc, ret: Record<string, any>) {
53
53
delete ret._id;
54
54
delete ret.__v;
55
55
}
@@ -71,7 +71,7 @@ export const loadoutSchema = new Schema<ILoadoutDatabase, loadoutModelType>({
71
71
});
72
72
73
73
loadoutSchema.set("toJSON", {
74
transform(_doc, ret, _options) {
74
transform(_doc, ret: Record<string, any>) {
75
75
delete ret._id;
76
76
delete ret.__v;
77
77
delete ret.loadoutOwnerId;
@@ -32,7 +32,7 @@ const databaseAccountSchema = new Schema<IDatabaseAccountJson>(
32
32
);
33
33
34
34
databaseAccountSchema.set("toJSON", {
35
transform(_document, returnedObject) {
35
transform(_document, returnedObject: Record<string, any>) {
36
36
delete returnedObject._id;
37
37
delete returnedObject.__v;
38
38
},
@@ -55,7 +55,7 @@ placedDecosSchema.virtual("id").get(function (this: IPlacedDecosDatabase) {
55
55
56
56
placedDecosSchema.set("toJSON", {
57
57
virtuals: true,
58
transform(_document, returnedObject) {
58
transform(_document, returnedObject: Record<string, any>) {
59
59
delete returnedObject._id;
60
60
}
61
61
});
@@ -78,7 +78,7 @@ const favouriteLoadoutSchema = new Schema<IFavouriteLoadoutDatabase>(
78
78
);
79
79
favouriteLoadoutSchema.set("toJSON", {
80
80
virtuals: true,
81
transform(_document, returnedObject) {
81
transform(_document, returnedObject: Record<string, any>) {
82
82
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
83
83
returnedObject.LoadoutId = toOid(returnedObject.LoadoutId);
84
84
}
@@ -95,7 +95,7 @@ const plantSchema = new Schema<IPlantDatabase>(
95
95
96
96
plantSchema.set("toJSON", {
97
97
virtuals: true,
98
transform(_doc, obj) {
98
transform(_doc, obj: Record<string, any>) {
99
99
const client = obj as IPlantClient;
100
100
const db = obj as IPlantDatabase;
101
101
@@ -158,7 +158,7 @@ const orbiterSchema = new Schema<IOrbiterDatabase>(
158
158
);
159
159
orbiterSchema.set("toJSON", {
160
160
virtuals: true,
161
transform(_doc, obj) {
161
transform(_doc, obj: Record<string, any>) {
162
162
const db = obj as IOrbiterDatabase;
163
163
const client = obj as IOrbiterClient;
164
164
@@ -22,7 +22,7 @@ shipSchema.virtual("ItemId").get(function () {
22
22
23
23
shipSchema.set("toJSON", {
24
24
virtuals: true,
25
transform(_document, returnedObject) {
25
transform(_document, returnedObject: Record<string, any>) {
26
26
const shipResponse = returnedObject as IShipInventory;
27
27
const shipDatabase = returnedObject as IShipDatabase;
28
28
delete returnedObject._id;
@@ -101,7 +101,7 @@ const statsSchema = new Schema<IStatsDatabase>({
101
101
});
102
102
103
103
statsSchema.set("toJSON", {
104
transform(_document, returnedObject) {
104
transform(_document, returnedObject: Record<string, any>) {
105
105
delete returnedObject._id;
106
106
delete returnedObject.__v;
107
107
delete returnedObject.accountOwnerId;