浏览代码

feat: save

gemercheung 9 月之前
父节点
当前提交
f0c3c88268
共有 5 个文件被更改,包括 20 次插入1 次删除
  1. 1 0
      .eslintrc.js
  2. 1 0
      package.json
  3. 15 0
      pnpm-lock.yaml
  4. 1 0
      src/logger/config.ts
  5. 2 1
      src/room/actions/action.d.ts

+ 1 - 0
.eslintrc.js

@@ -21,5 +21,6 @@ module.exports = {
     '@typescript-eslint/explicit-function-return-type': 'off',
     '@typescript-eslint/explicit-module-boundary-types': 'off',
     '@typescript-eslint/no-explicit-any': 'off',
+    "@typescript-eslint/ban-ts-comment": "off",
   },
 };

+ 1 - 0
package.json

@@ -37,6 +37,7 @@
     "chalk": "^4",
     "dayjs": "^1.11.7",
     "dotenv": "^16.0.3",
+    "helmet": "^7.0.0",
     "ioredis": "^5.3.1",
     "logform": "^2.5.1",
     "nest-nacos": "^0.4.2",

+ 15 - 0
pnpm-lock.yaml

@@ -1,5 +1,9 @@
 lockfileVersion: '6.0'
 
+settings:
+  autoInstallPeers: true
+  excludeLinksFromLockfile: false
+
 dependencies:
   '@liaoliaots/nestjs-redis':
     specifier: ^9.0.5
@@ -49,6 +53,9 @@ dependencies:
   dotenv:
     specifier: ^16.0.3
     version: 16.0.3
+  helmet:
+    specifier: ^7.0.0
+    version: 7.0.0
   ioredis:
     specifier: ^5.3.1
     version: 5.3.1
@@ -3720,6 +3727,11 @@ packages:
     dependencies:
       function-bind: 1.1.1
 
+  /helmet@7.0.0:
+    resolution: {integrity: sha512-MsIgYmdBh460ZZ8cJC81q4XJknjG567wzEmv46WOBblDb6TUd3z8/GhgmsM9pn8g2B80tAJ4m5/d3Bi1KrSUBQ==}
+    engines: {node: '>=16.0.0'}
+    dev: false
+
   /hexoid@1.0.0:
     resolution: {integrity: sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==}
     engines: {node: '>=8'}
@@ -5323,6 +5335,7 @@ packages:
   /pidusage@2.0.21:
     resolution: {integrity: sha512-cv3xAQos+pugVX+BfXpHsbyz/dLzX+lr44zNMsYiGxUw+kV5sgQCIcLd1z+0vq+KyC7dJ+/ts2PsfgWfSC3WXA==}
     engines: {node: '>=8'}
+    requiresBuild: true
     dependencies:
       safe-buffer: 5.2.1
     dev: false
@@ -6180,6 +6193,7 @@ packages:
     engines: {node: '>=8.0.0'}
     os: [darwin, linux, win32, freebsd, openbsd, netbsd, sunos, android]
     hasBin: true
+    requiresBuild: true
     dev: false
     optional: true
 
@@ -6453,6 +6467,7 @@ packages:
 
   /tx2@1.0.5:
     resolution: {integrity: sha512-sJ24w0y03Md/bxzK4FU8J8JveYYUbSs2FViLJ2D/8bytSiyPRbuE3DyL/9UKYXTZlV3yXq0L8GLlhobTnekCVg==}
+    requiresBuild: true
     dependencies:
       json-stringify-safe: 5.0.1
     dev: false

+ 1 - 0
src/logger/config.ts

@@ -28,6 +28,7 @@ export function nestLikeConsoleFormat(
         // Only format the timestamp to a locale representation if it's ISO 8601 format. Any format
         // That is not a valid date string will throw, just ignore it (it will be printed as-is).
         try {
+          //@ts-ignore
           if (timestamp === new Date(timestamp).toISOString())
             // eslint-disable-next-line no-param-reassign
             timestamp = new Date(timestamp).toLocaleString();

+ 2 - 1
src/room/actions/action.d.ts

@@ -20,7 +20,8 @@ type actionType =
   | 'sync-floor'
   | 'room-valid-time'
   | 'users-kicked'
-  | 'set-assistant';
+  | 'set-assistant'
+  | 'sync-tag';
 
 interface DanmakuDataType {
   nickname: string;