File size: 430 Bytes
b39afbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * Copyright (c) 2023 MERCENARIES.AI PTE. LTD.
 * All rights reserved.
 */
import { User } from 'omni-shared'

const script = {
    name: 'hasKey',
  
    exec: async function (ctx, payload) {
  
      const credentialService = ctx.app.services.get('credentials')
      const keyList = await credentialService.listKeyMetadata(ctx.userId, User.modelName)
      return keyList?.length > 0
    }
  }
  
  export default script