Browse Source

fix type error

Yuki Takei 2 months ago
parent
commit
f69278f3d0
1 changed files with 5 additions and 2 deletions
  1. 5 2
      packages/remark-attachment-refs/src/server/routes/refs.ts

+ 5 - 2
packages/remark-attachment-refs/src/server/routes/refs.ts

@@ -1,5 +1,6 @@
-import type { IAttachment, IPage, IUser } from '@growi/core';
+import type { IAttachment, IPage, IUser } from '@growi/core/dist/interfaces';
 import { SCOPE } from '@growi/core/dist/interfaces';
 import { SCOPE } from '@growi/core/dist/interfaces';
+import type { AccessTokenParser } from '@growi/core/dist/interfaces/server';
 import { serializeAttachmentSecurely } from '@growi/core/dist/models/serializers';
 import { serializeAttachmentSecurely } from '@growi/core/dist/models/serializers';
 import { OptionParser } from '@growi/core/dist/remark-plugins';
 import { OptionParser } from '@growi/core/dist/remark-plugins';
 import type { Request } from 'express';
 import type { Request } from 'express';
@@ -73,7 +74,7 @@ export const routesFactory = (crowi): any => {
     true,
     true,
     loginRequiredFallback,
     loginRequiredFallback,
   );
   );
-  const accessTokenParser = crowi.accessTokenParser;
+  const accessTokenParser: AccessTokenParser = crowi.accessTokenParser;
 
 
   const router = Router();
   const router = Router();
 
 
@@ -92,6 +93,8 @@ export const routesFactory = (crowi): any => {
    */
    */
   router.get(
   router.get(
     '/ref',
     '/ref',
+    // biome-ignore lint/suspicious/noTsIgnore: Suppress auto fix by lefthook
+    // @ts-ignore - Scope type causes "Type instantiation is excessively deep" with tsgo
     accessTokenParser([SCOPE.READ.FEATURES.PAGE], { acceptLegacy: true }),
     accessTokenParser([SCOPE.READ.FEATURES.PAGE], { acceptLegacy: true }),
     loginRequired,
     loginRequired,
     async (req: RequestWithUser, res) => {
     async (req: RequestWithUser, res) => {