@enjoys/context-engine 1.2.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/codeActions/angular.json +126 -0
- package/data/codeActions/css.json +111 -0
- package/data/codeActions/nestjs.json +124 -0
- package/data/codeActions/nextjs.json +198 -0
- package/data/codeActions/react.json +154 -0
- package/data/codeActions/shadcn.json +112 -0
- package/data/codeActions/shell.json +169 -26
- package/data/codeActions/tailwindcss.json +76 -0
- package/data/codeLens/angular.json +22 -0
- package/data/codeLens/css.json +68 -0
- package/data/codeLens/nestjs.json +21 -0
- package/data/codeLens/nextjs.json +117 -0
- package/data/codeLens/react.json +89 -0
- package/data/codeLens/shadcn.json +89 -0
- package/data/codeLens/shell.json +59 -17
- package/data/codeLens/tailwindcss.json +103 -0
- package/data/color/angular.json +21 -0
- package/data/color/css.json +124 -0
- package/data/color/nestjs.json +18 -0
- package/data/color/nextjs.json +22 -0
- package/data/color/react.json +93 -0
- package/data/color/shadcn.json +66 -0
- package/data/color/shell.json +106 -80
- package/data/color/tailwindcss.json +53 -0
- package/data/commands/angular.json +312 -0
- package/data/commands/css.json +41 -0
- package/data/commands/manifest.json +734 -727
- package/data/commands/nestjs.json +273 -0
- package/data/commands/nextjs.json +123 -0
- package/data/commands/react.json +210 -0
- package/data/commands/shadcn.json +410 -0
- package/data/commands/shell.json +571 -41
- package/data/commands/tailwindcss.json +53 -0
- package/data/completion/angular.json +1490 -0
- package/data/completion/css.json +1176 -0
- package/data/completion/javascript.json +27 -0
- package/data/completion/nestjs.json +1454 -0
- package/data/completion/nextjs.json +1373 -0
- package/data/completion/react.json +1319 -0
- package/data/completion/redis-cli.json +1 -1
- package/data/completion/shadcn.json +1202 -0
- package/data/completion/shell.json +2446 -510
- package/data/completion/tailwindcss.json +284 -0
- package/data/completion/typescript.json +27 -0
- package/data/declaration/angular.json +46 -0
- package/data/declaration/css.json +59 -0
- package/data/declaration/nestjs.json +47 -0
- package/data/declaration/nextjs.json +274 -0
- package/data/declaration/react.json +199 -0
- package/data/declaration/shadcn.json +211 -0
- package/data/declaration/shell.json +343 -24
- package/data/declaration/tailwindcss.json +137 -0
- package/data/definition/angular.json +670 -0
- package/data/definition/css.json +115 -0
- package/data/definition/nestjs.json +684 -0
- package/data/definition/nextjs.json +439 -0
- package/data/definition/react.json +397 -0
- package/data/definition/redis-cli.json +1 -1
- package/data/definition/shadcn.json +99 -0
- package/data/definition/shell.json +820 -0
- package/data/definition/tailwindcss.json +115 -0
- package/data/documentHighlight/angular.json +414 -0
- package/data/documentHighlight/css.json +125 -0
- package/data/documentHighlight/nestjs.json +115 -0
- package/data/documentHighlight/nextjs.json +212 -0
- package/data/documentHighlight/react.json +119 -0
- package/data/documentHighlight/shadcn.json +168 -0
- package/data/documentHighlight/shell.json +664 -334
- package/data/documentHighlight/tailwindcss.json +160 -0
- package/data/documentRangeFormatting/angular.json +45 -0
- package/data/documentRangeFormatting/css.json +101 -0
- package/data/documentRangeFormatting/nestjs.json +17 -0
- package/data/documentRangeFormatting/nextjs.json +17 -0
- package/data/documentRangeFormatting/react.json +78 -0
- package/data/documentRangeFormatting/shadcn.json +45 -0
- package/data/documentRangeFormatting/shell.json +120 -53
- package/data/documentRangeFormatting/tailwindcss.json +55 -0
- package/data/documentSymbol/angular.json +180 -0
- package/data/documentSymbol/css.json +96 -0
- package/data/documentSymbol/nestjs.json +152 -0
- package/data/documentSymbol/nextjs.json +159 -0
- package/data/documentSymbol/react.json +145 -0
- package/data/documentSymbol/shadcn.json +131 -0
- package/data/documentSymbol/shell.json +166 -26
- package/data/documentSymbol/tailwindcss.json +110 -0
- package/data/foldingRange/angular.json +99 -0
- package/data/foldingRange/css.json +66 -0
- package/data/foldingRange/nestjs.json +26 -0
- package/data/foldingRange/nextjs.json +26 -0
- package/data/foldingRange/react.json +120 -0
- package/data/foldingRange/shadcn.json +93 -0
- package/data/foldingRange/shell.json +106 -46
- package/data/foldingRange/tailwindcss.json +60 -0
- package/data/formatting/angular.json +21 -0
- package/data/formatting/css.json +73 -0
- package/data/formatting/nestjs.json +23 -0
- package/data/formatting/nextjs.json +23 -0
- package/data/formatting/react.json +71 -0
- package/data/formatting/shadcn.json +61 -0
- package/data/formatting/shell.json +103 -19
- package/data/formatting/tailwindcss.json +48 -0
- package/data/hover/angular.json +455 -0
- package/data/hover/css.json +300 -0
- package/data/hover/nestjs.json +296 -0
- package/data/hover/nextjs.json +305 -0
- package/data/hover/react.json +173 -0
- package/data/hover/redis-cli.json +1 -1
- package/data/hover/shadcn.json +450 -0
- package/data/hover/shell.json +684 -75
- package/data/hover/tailwindcss.json +968 -0
- package/data/implementation/angular.json +22 -0
- package/data/implementation/css.json +65 -0
- package/data/implementation/nestjs.json +24 -0
- package/data/implementation/nextjs.json +137 -0
- package/data/implementation/react.json +125 -0
- package/data/implementation/shadcn.json +89 -0
- package/data/implementation/shell.json +59 -3
- package/data/implementation/tailwindcss.json +59 -0
- package/data/inlayHints/angular.json +24 -0
- package/data/inlayHints/css.json +87 -0
- package/data/inlayHints/nestjs.json +24 -0
- package/data/inlayHints/nextjs.json +143 -0
- package/data/inlayHints/react.json +177 -0
- package/data/inlayHints/shadcn.json +109 -0
- package/data/inlayHints/shell.json +223 -35
- package/data/inlayHints/tailwindcss.json +111 -0
- package/data/inlineCompletions/angular.json +135 -0
- package/data/inlineCompletions/css.json +125 -0
- package/data/inlineCompletions/javascript.json +12 -0
- package/data/inlineCompletions/nestjs.json +25 -0
- package/data/inlineCompletions/nextjs.json +179 -0
- package/data/inlineCompletions/react.json +203 -0
- package/data/inlineCompletions/shadcn.json +115 -0
- package/data/inlineCompletions/shell.json +185 -35
- package/data/inlineCompletions/tailwindcss.json +411 -0
- package/data/inlineCompletions/typescript.json +12 -0
- package/data/linkedEditingRange/angular.json +23 -0
- package/data/linkedEditingRange/css.json +40 -0
- package/data/linkedEditingRange/nestjs.json +10 -0
- package/data/linkedEditingRange/nextjs.json +11 -0
- package/data/linkedEditingRange/react.json +75 -0
- package/data/linkedEditingRange/shadcn.json +23 -0
- package/data/linkedEditingRange/shell.json +25 -25
- package/data/linkedEditingRange/tailwindcss.json +30 -0
- package/data/links/angular.json +95 -0
- package/data/links/css.json +55 -0
- package/data/links/nestjs.json +130 -0
- package/data/links/nextjs.json +91 -0
- package/data/links/react.json +75 -0
- package/data/links/shadcn.json +98 -0
- package/data/links/shell.json +56 -0
- package/data/links/tailwindcss.json +65 -0
- package/data/manifest.json +399 -150
- package/data/onTypeFormatting/angular.json +14 -0
- package/data/onTypeFormatting/css.json +82 -0
- package/data/onTypeFormatting/nestjs.json +16 -0
- package/data/onTypeFormatting/nextjs.json +17 -0
- package/data/onTypeFormatting/react.json +127 -0
- package/data/onTypeFormatting/shadcn.json +54 -0
- package/data/onTypeFormatting/shell.json +72 -68
- package/data/onTypeFormatting/tailwindcss.json +63 -0
- package/data/rangeSemanticTokens/angular.json +140 -0
- package/data/rangeSemanticTokens/css.json +125 -0
- package/data/rangeSemanticTokens/nestjs.json +27 -0
- package/data/rangeSemanticTokens/nextjs.json +28 -0
- package/data/rangeSemanticTokens/react.json +216 -0
- package/data/rangeSemanticTokens/shadcn.json +140 -0
- package/data/rangeSemanticTokens/shell.json +247 -69
- package/data/rangeSemanticTokens/tailwindcss.json +186 -0
- package/data/references/angular.json +26 -0
- package/data/references/css.json +65 -0
- package/data/references/nestjs.json +24 -0
- package/data/references/nextjs.json +178 -0
- package/data/references/react.json +192 -0
- package/data/references/shadcn.json +101 -0
- package/data/references/shell.json +323 -92
- package/data/references/tailwindcss.json +125 -0
- package/data/rename/angular.json +131 -0
- package/data/rename/css.json +91 -0
- package/data/rename/nestjs.json +32 -0
- package/data/rename/nextjs.json +31 -0
- package/data/rename/react.json +88 -0
- package/data/rename/shadcn.json +79 -0
- package/data/rename/shell.json +101 -31
- package/data/rename/tailwindcss.json +58 -0
- package/data/selectionRange/angular.json +95 -0
- package/data/selectionRange/css.json +55 -0
- package/data/selectionRange/nestjs.json +21 -0
- package/data/selectionRange/nextjs.json +22 -0
- package/data/selectionRange/react.json +87 -0
- package/data/selectionRange/shadcn.json +89 -0
- package/data/selectionRange/shell.json +65 -35
- package/data/selectionRange/tailwindcss.json +35 -0
- package/data/semanticTokens/angular.json +198 -0
- package/data/semanticTokens/css.json +107 -0
- package/data/semanticTokens/nestjs.json +35 -0
- package/data/semanticTokens/nextjs.json +38 -0
- package/data/semanticTokens/react.json +215 -0
- package/data/semanticTokens/shadcn.json +180 -0
- package/data/semanticTokens/shell.json +238 -65
- package/data/semanticTokens/tailwindcss.json +161 -0
- package/data/signatureHelp/angular.json +182 -0
- package/data/signatureHelp/css.json +137 -0
- package/data/signatureHelp/nestjs.json +128 -0
- package/data/signatureHelp/nextjs.json +127 -0
- package/data/signatureHelp/react.json +281 -0
- package/data/signatureHelp/shadcn.json +237 -0
- package/data/signatureHelp/shell.json +797 -104
- package/data/signatureHelp/tailwindcss.json +64 -0
- package/data/typeDefinition/angular.json +362 -0
- package/data/typeDefinition/css.json +53 -0
- package/data/typeDefinition/nestjs.json +334 -0
- package/data/typeDefinition/nextjs.json +285 -0
- package/data/typeDefinition/react.json +236 -0
- package/data/typeDefinition/shadcn.json +292 -0
- package/data/typeDefinition/shell.json +104 -40
- package/data/typeDefinition/tailwindcss.json +47 -0
- package/package.json +1 -1
- package/data/codeActions/bash.json +0 -169
- package/data/codeActions/zsh.json +0 -49
- package/data/codeLens/bash.json +0 -75
- package/data/codeLens/zsh.json +0 -19
- package/data/color/bash.json +0 -100
- package/data/color/zsh.json +0 -80
- package/data/commands/bash.json +0 -102
- package/data/commands/zsh.json +0 -166
- package/data/completion/bash.json +0 -1184
- package/data/completion/zsh.json +0 -973
- package/data/declaration/bash.json +0 -301
- package/data/declaration/zsh.json +0 -205
- package/data/definition/bash.json +0 -565
- package/data/definition/zsh.json +0 -350
- package/data/documentHighlight/bash.json +0 -393
- package/data/documentHighlight/zsh.json +0 -266
- package/data/documentRangeFormatting/bash.json +0 -41
- package/data/documentRangeFormatting/zsh.json +0 -59
- package/data/documentSymbol/bash.json +0 -124
- package/data/documentSymbol/zsh.json +0 -26
- package/data/foldingRange/bash.json +0 -76
- package/data/foldingRange/zsh.json +0 -46
- package/data/formatting/bash.json +0 -88
- package/data/formatting/zsh.json +0 -28
- package/data/hover/bash.json +0 -579
- package/data/hover/zsh.json +0 -96
- package/data/implementation/bash.json +0 -44
- package/data/implementation/zsh.json +0 -41
- package/data/inlayHints/bash.json +0 -207
- package/data/inlayHints/zsh.json +0 -43
- package/data/inlineCompletions/bash.json +0 -155
- package/data/inlineCompletions/zsh.json +0 -17
- package/data/linkedEditingRange/bash.json +0 -25
- package/data/linkedEditingRange/zsh.json +0 -25
- package/data/links/bash.json +0 -56
- package/data/links/zsh.json +0 -15
- package/data/onTypeFormatting/bash.json +0 -68
- package/data/onTypeFormatting/zsh.json +0 -68
- package/data/rangeSemanticTokens/bash.json +0 -90
- package/data/rangeSemanticTokens/zsh.json +0 -76
- package/data/references/bash.json +0 -221
- package/data/references/zsh.json +0 -166
- package/data/rename/bash.json +0 -37
- package/data/rename/zsh.json +0 -31
- package/data/selectionRange/bash.json +0 -35
- package/data/selectionRange/zsh.json +0 -35
- package/data/semanticTokens/bash.json +0 -71
- package/data/semanticTokens/zsh.json +0 -71
- package/data/signatureHelp/bash.json +0 -111
- package/data/signatureHelp/zsh.json +0 -118
- package/data/typeDefinition/bash.json +0 -95
- package/data/typeDefinition/zsh.json +0 -40
|
@@ -0,0 +1,1454 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "nestjs",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "nest-controller",
|
|
6
|
+
"kind": 28,
|
|
7
|
+
"detail": "NestJS Controller Class",
|
|
8
|
+
"documentation": { "value": "Creates a NestJS controller with route prefix and sample GET endpoint." },
|
|
9
|
+
"insertText": "import { Controller, Get } from '@nestjs/common';\nimport { ${1:AppService} } from './${2:app}.service';\n\n@Controller('${3:route}')\nexport class ${4:App}Controller {\n constructor(private readonly ${5:appService}: ${1:AppService}) {}\n\n @Get()\n findAll() {\n return this.${5:appService}.findAll();\n }\n}",
|
|
10
|
+
"insertTextRules": 4,
|
|
11
|
+
"sortText": "00_nest-controller"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "nest-module",
|
|
15
|
+
"kind": 28,
|
|
16
|
+
"detail": "NestJS Module Definition",
|
|
17
|
+
"documentation": { "value": "Creates a NestJS module with imports, controllers, providers, and exports arrays." },
|
|
18
|
+
"insertText": "import { Module } from '@nestjs/common';\nimport { ${1:App}Controller } from './${2:app}.controller';\nimport { ${3:App}Service } from './${2:app}.service';\n\n@Module({\n imports: [${4}],\n controllers: [${1:App}Controller],\n providers: [${3:App}Service],\n exports: [${5}]\n})\nexport class ${6:App}Module {}",
|
|
19
|
+
"insertTextRules": 4,
|
|
20
|
+
"sortText": "00_nest-module"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "nest-service",
|
|
24
|
+
"kind": 28,
|
|
25
|
+
"detail": "NestJS Injectable Service",
|
|
26
|
+
"documentation": { "value": "Creates a NestJS injectable service class with constructor." },
|
|
27
|
+
"insertText": "import { Injectable } from '@nestjs/common';\n\n@Injectable()\nexport class ${1:App}Service {\n constructor(${2}) {}\n\n findAll() {\n return ${3:'This action returns all items'};\n }\n}",
|
|
28
|
+
"insertTextRules": 4,
|
|
29
|
+
"sortText": "00_nest-service"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "nest-guard",
|
|
33
|
+
"kind": 28,
|
|
34
|
+
"detail": "NestJS Guard Implementation",
|
|
35
|
+
"documentation": { "value": "Creates a NestJS guard implementing CanActivate interface." },
|
|
36
|
+
"insertText": "import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common';\nimport { Observable } from 'rxjs';\n\n@Injectable()\nexport class ${1:Auth}Guard implements CanActivate {\n canActivate(\n context: ExecutionContext,\n ): boolean | Promise<boolean> | Observable<boolean> {\n const request = context.switchToHttp().getRequest();\n ${0:// validate request}\n return true;\n }\n}",
|
|
37
|
+
"insertTextRules": 4,
|
|
38
|
+
"sortText": "00_nest-guard"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "nest-pipe",
|
|
42
|
+
"kind": 28,
|
|
43
|
+
"detail": "NestJS Pipe Implementation",
|
|
44
|
+
"documentation": { "value": "Creates a NestJS custom pipe implementing PipeTransform." },
|
|
45
|
+
"insertText": "import { PipeTransform, Injectable, ArgumentMetadata, BadRequestException } from '@nestjs/common';\n\n@Injectable()\nexport class ${1:Validation}Pipe implements PipeTransform {\n transform(value: any, metadata: ArgumentMetadata) {\n ${0:// transform and validate}\n return value;\n }\n}",
|
|
46
|
+
"insertTextRules": 4,
|
|
47
|
+
"sortText": "00_nest-pipe"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "nest-interceptor",
|
|
51
|
+
"kind": 28,
|
|
52
|
+
"detail": "NestJS Interceptor Implementation",
|
|
53
|
+
"documentation": { "value": "Creates a NestJS interceptor implementing NestInterceptor." },
|
|
54
|
+
"insertText": "import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\n@Injectable()\nexport class ${1:Transform}Interceptor implements NestInterceptor {\n intercept(context: ExecutionContext, next: CallHandler): Observable<any> {\n return next.handle().pipe(\n map(data => ({\n ${0:data}\n })),\n );\n }\n}",
|
|
55
|
+
"insertTextRules": 4,
|
|
56
|
+
"sortText": "00_nest-interceptor"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "nest-filter",
|
|
60
|
+
"kind": 28,
|
|
61
|
+
"detail": "NestJS Exception Filter",
|
|
62
|
+
"documentation": { "value": "Creates a NestJS exception filter implementing ExceptionFilter." },
|
|
63
|
+
"insertText": "import { ExceptionFilter, Catch, ArgumentsHost, HttpException } from '@nestjs/common';\nimport { Request, Response } from 'express';\n\n@Catch(HttpException)\nexport class ${1:Http}ExceptionFilter implements ExceptionFilter {\n catch(exception: HttpException, host: ArgumentsHost) {\n const ctx = host.switchToHttp();\n const response = ctx.getResponse<Response>();\n const request = ctx.getRequest<Request>();\n const status = exception.getStatus();\n\n response.status(status).json({\n statusCode: status,\n timestamp: new Date().toISOString(),\n path: request.url,\n message: exception.message,\n });\n }\n}",
|
|
64
|
+
"insertTextRules": 4,
|
|
65
|
+
"sortText": "00_nest-filter"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "nest-middleware",
|
|
69
|
+
"kind": 28,
|
|
70
|
+
"detail": "NestJS Middleware",
|
|
71
|
+
"documentation": { "value": "Creates a NestJS middleware implementing NestMiddleware." },
|
|
72
|
+
"insertText": "import { Injectable, NestMiddleware } from '@nestjs/common';\nimport { Request, Response, NextFunction } from 'express';\n\n@Injectable()\nexport class ${1:Logger}Middleware implements NestMiddleware {\n use(req: Request, res: Response, next: NextFunction) {\n ${0:console.log(`[${req.method}] ${req.url}`);}\n next();\n }\n}",
|
|
73
|
+
"insertTextRules": 4,
|
|
74
|
+
"sortText": "00_nest-middleware"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "nest-gateway",
|
|
78
|
+
"kind": 28,
|
|
79
|
+
"detail": "NestJS WebSocket Gateway",
|
|
80
|
+
"documentation": { "value": "Creates a NestJS WebSocket gateway with event handling." },
|
|
81
|
+
"insertText": "import {\n WebSocketGateway,\n SubscribeMessage,\n MessageBody,\n WebSocketServer,\n ConnectedSocket,\n} from '@nestjs/websockets';\nimport { Server, Socket } from 'socket.io';\n\n@WebSocketGateway({ cors: { origin: '*' } })\nexport class ${1:Events}Gateway {\n @WebSocketServer()\n server: Server;\n\n @SubscribeMessage('${2:message}')\n handle${3:Message}(@MessageBody() data: ${4:string}, @ConnectedSocket() client: Socket) {\n ${0:return data;}\n }\n}",
|
|
82
|
+
"insertTextRules": 4,
|
|
83
|
+
"sortText": "00_nest-gateway"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": "nest-microservice",
|
|
87
|
+
"kind": 28,
|
|
88
|
+
"detail": "NestJS Microservice Handler",
|
|
89
|
+
"documentation": { "value": "Creates a NestJS microservice controller with message patterns." },
|
|
90
|
+
"insertText": "import { Controller } from '@nestjs/common';\nimport { MessagePattern, Payload } from '@nestjs/microservices';\n\n@Controller()\nexport class ${1:App}Controller {\n @MessagePattern('${2:pattern}')\n handle${3:Message}(@Payload() data: ${4:any}) {\n ${0:return data;}\n }\n}",
|
|
91
|
+
"insertTextRules": 4,
|
|
92
|
+
"sortText": "00_nest-microservice"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "nest-crud",
|
|
96
|
+
"kind": 28,
|
|
97
|
+
"detail": "NestJS CRUD Controller",
|
|
98
|
+
"documentation": { "value": "Creates a full CRUD controller with all HTTP methods." },
|
|
99
|
+
"insertText": "import { Controller, Get, Post, Put, Delete, Param, Body } from '@nestjs/common';\nimport { ${1:App}Service } from './${2:app}.service';\nimport { Create${3:Item}Dto } from './dto/create-${2:app}.dto';\nimport { Update${3:Item}Dto } from './dto/update-${2:app}.dto';\n\n@Controller('${4:items}')\nexport class ${1:App}Controller {\n constructor(private readonly ${5:service}: ${1:App}Service) {}\n\n @Post()\n create(@Body() dto: Create${3:Item}Dto) {\n return this.${5:service}.create(dto);\n }\n\n @Get()\n findAll() {\n return this.${5:service}.findAll();\n }\n\n @Get(':id')\n findOne(@Param('id') id: string) {\n return this.${5:service}.findOne(id);\n }\n\n @Put(':id')\n update(@Param('id') id: string, @Body() dto: Update${3:Item}Dto) {\n return this.${5:service}.update(id, dto);\n }\n\n @Delete(':id')\n remove(@Param('id') id: string) {\n return this.${5:service}.remove(id);\n }\n}",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "00_nest-crud"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "nest-entity",
|
|
105
|
+
"kind": 28,
|
|
106
|
+
"detail": "TypeORM Entity Definition",
|
|
107
|
+
"documentation": { "value": "Creates a TypeORM entity class with common decorators." },
|
|
108
|
+
"insertText": "import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';\n\n@Entity('${1:items}')\nexport class ${2:Item} {\n @PrimaryGeneratedColumn('uuid')\n id: string;\n\n @Column()\n ${3:name}: string;\n\n @CreateDateColumn()\n createdAt: Date;\n\n @UpdateDateColumn()\n updatedAt: Date;\n}",
|
|
109
|
+
"insertTextRules": 4,
|
|
110
|
+
"sortText": "00_nest-entity"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "nest-dto",
|
|
114
|
+
"kind": 28,
|
|
115
|
+
"detail": "NestJS DTO Class",
|
|
116
|
+
"documentation": { "value": "Creates a DTO class with class-validator decorators." },
|
|
117
|
+
"insertText": "import { IsString, IsNotEmpty, IsOptional } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\n\nexport class ${1:Create}${2:Item}Dto {\n @ApiProperty({ description: '${3:Name of the item}' })\n @IsString()\n @IsNotEmpty()\n ${4:name}: string;\n\n @ApiProperty({ description: '${5:Description}', required: false })\n @IsString()\n @IsOptional()\n ${6:description}?: string;\n}",
|
|
118
|
+
"insertTextRules": 4,
|
|
119
|
+
"sortText": "00_nest-dto"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"label": "nest-e2e-test",
|
|
123
|
+
"kind": 28,
|
|
124
|
+
"detail": "NestJS E2E Test",
|
|
125
|
+
"documentation": { "value": "Creates a NestJS end-to-end test with supertest." },
|
|
126
|
+
"insertText": "import { Test, TestingModule } from '@nestjs/testing';\nimport { INestApplication } from '@nestjs/common';\nimport * as request from 'supertest';\nimport { ${1:App}Module } from '../src/${2:app}.module';\n\ndescribe('${3:AppController} (e2e)', () => {\n let app: INestApplication;\n\n beforeEach(async () => {\n const moduleFixture: TestingModule = await Test.createTestingModule({\n imports: [${1:App}Module],\n }).compile();\n\n app = moduleFixture.createNestApplication();\n await app.init();\n });\n\n afterAll(async () => {\n await app.close();\n });\n\n it('/ (GET)', () => {\n return request(app.getHttpServer())\n .get('/')\n .expect(200);\n });\n});",
|
|
127
|
+
"insertTextRules": 4,
|
|
128
|
+
"sortText": "00_nest-e2e-test"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": "nest-unit-test",
|
|
132
|
+
"kind": 28,
|
|
133
|
+
"detail": "NestJS Unit Test",
|
|
134
|
+
"documentation": { "value": "Creates a NestJS unit test for a service with TestingModule." },
|
|
135
|
+
"insertText": "import { Test, TestingModule } from '@nestjs/testing';\nimport { ${1:App}Service } from './${2:app}.service';\n\ndescribe('${1:App}Service', () => {\n let service: ${1:App}Service;\n\n beforeEach(async () => {\n const module: TestingModule = await Test.createTestingModule({\n providers: [${1:App}Service],\n }).compile();\n\n service = module.get<${1:App}Service>(${1:App}Service);\n });\n\n it('should be defined', () => {\n expect(service).toBeDefined();\n });\n});",
|
|
136
|
+
"insertTextRules": 4,
|
|
137
|
+
"sortText": "00_nest-unit-test"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": "@Controller",
|
|
141
|
+
"kind": 1,
|
|
142
|
+
"detail": "Controller decorator",
|
|
143
|
+
"documentation": { "value": "Marks a class as a NestJS controller. Accepts an optional route path prefix." },
|
|
144
|
+
"insertText": "@Controller('${1:route}')",
|
|
145
|
+
"insertTextRules": 4,
|
|
146
|
+
"sortText": "01_@Controller"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"label": "@Get",
|
|
150
|
+
"kind": 1,
|
|
151
|
+
"detail": "HTTP GET decorator",
|
|
152
|
+
"documentation": { "value": "Routes HTTP GET requests to the decorated method. Accepts an optional path." },
|
|
153
|
+
"insertText": "@Get('${1}')",
|
|
154
|
+
"insertTextRules": 4,
|
|
155
|
+
"sortText": "01_@Get"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"label": "@Post",
|
|
159
|
+
"kind": 1,
|
|
160
|
+
"detail": "HTTP POST decorator",
|
|
161
|
+
"documentation": { "value": "Routes HTTP POST requests to the decorated method. Accepts an optional path." },
|
|
162
|
+
"insertText": "@Post('${1}')",
|
|
163
|
+
"insertTextRules": 4,
|
|
164
|
+
"sortText": "01_@Post"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"label": "@Put",
|
|
168
|
+
"kind": 1,
|
|
169
|
+
"detail": "HTTP PUT decorator",
|
|
170
|
+
"documentation": { "value": "Routes HTTP PUT requests to the decorated method. Accepts an optional path." },
|
|
171
|
+
"insertText": "@Put('${1}')",
|
|
172
|
+
"insertTextRules": 4,
|
|
173
|
+
"sortText": "01_@Put"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"label": "@Patch",
|
|
177
|
+
"kind": 1,
|
|
178
|
+
"detail": "HTTP PATCH decorator",
|
|
179
|
+
"documentation": { "value": "Routes HTTP PATCH requests to the decorated method. Accepts an optional path." },
|
|
180
|
+
"insertText": "@Patch('${1}')",
|
|
181
|
+
"insertTextRules": 4,
|
|
182
|
+
"sortText": "01_@Patch"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": "@Delete",
|
|
186
|
+
"kind": 1,
|
|
187
|
+
"detail": "HTTP DELETE decorator",
|
|
188
|
+
"documentation": { "value": "Routes HTTP DELETE requests to the decorated method. Accepts an optional path." },
|
|
189
|
+
"insertText": "@Delete('${1}')",
|
|
190
|
+
"insertTextRules": 4,
|
|
191
|
+
"sortText": "01_@Delete"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": "@Module",
|
|
195
|
+
"kind": 1,
|
|
196
|
+
"detail": "Module decorator",
|
|
197
|
+
"documentation": { "value": "Marks a class as a NestJS module. Accepts metadata: imports, controllers, providers, exports." },
|
|
198
|
+
"insertText": "@Module({\n imports: [${1}],\n controllers: [${2}],\n providers: [${3}],\n exports: [${4}]\n})",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "01_@Module"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "@Injectable",
|
|
204
|
+
"kind": 1,
|
|
205
|
+
"detail": "Injectable decorator",
|
|
206
|
+
"documentation": { "value": "Marks a class as a provider that can be managed by the NestJS IoC container." },
|
|
207
|
+
"insertText": "@Injectable()",
|
|
208
|
+
"insertTextRules": 4,
|
|
209
|
+
"sortText": "01_@Injectable"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": "@Inject",
|
|
213
|
+
"kind": 1,
|
|
214
|
+
"detail": "Inject decorator",
|
|
215
|
+
"documentation": { "value": "Injects a provider by token. Used for non-class-based (custom) provider injection." },
|
|
216
|
+
"insertText": "@Inject(${1:TOKEN})",
|
|
217
|
+
"insertTextRules": 4,
|
|
218
|
+
"sortText": "01_@Inject"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"label": "@Optional",
|
|
222
|
+
"kind": 1,
|
|
223
|
+
"detail": "Optional decorator",
|
|
224
|
+
"documentation": { "value": "Marks a constructor parameter as optional. Prevents errors when the provider is not available." },
|
|
225
|
+
"insertText": "@Optional()",
|
|
226
|
+
"insertTextRules": 4,
|
|
227
|
+
"sortText": "01_@Optional"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"label": "@Body",
|
|
231
|
+
"kind": 1,
|
|
232
|
+
"detail": "Body parameter decorator",
|
|
233
|
+
"documentation": { "value": "Extracts the request body. Accepts an optional property key." },
|
|
234
|
+
"insertText": "@Body(${1}) ${2:body}: ${3:any}",
|
|
235
|
+
"insertTextRules": 4,
|
|
236
|
+
"sortText": "01_@Body"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"label": "@Param",
|
|
240
|
+
"kind": 1,
|
|
241
|
+
"detail": "Param decorator",
|
|
242
|
+
"documentation": { "value": "Extracts a route parameter. Accepts an optional parameter name." },
|
|
243
|
+
"insertText": "@Param('${1:id}') ${1:id}: ${2:string}",
|
|
244
|
+
"insertTextRules": 4,
|
|
245
|
+
"sortText": "01_@Param"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"label": "@Query",
|
|
249
|
+
"kind": 1,
|
|
250
|
+
"detail": "Query parameter decorator",
|
|
251
|
+
"documentation": { "value": "Extracts query string parameters. Accepts an optional query key." },
|
|
252
|
+
"insertText": "@Query('${1}') ${2:query}: ${3:string}",
|
|
253
|
+
"insertTextRules": 4,
|
|
254
|
+
"sortText": "01_@Query"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"label": "@Headers",
|
|
258
|
+
"kind": 1,
|
|
259
|
+
"detail": "Headers decorator",
|
|
260
|
+
"documentation": { "value": "Extracts headers from the request. Accepts an optional header name." },
|
|
261
|
+
"insertText": "@Headers('${1}') ${2:headers}: ${3:string}",
|
|
262
|
+
"insertTextRules": 4,
|
|
263
|
+
"sortText": "01_@Headers"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"label": "@Req",
|
|
267
|
+
"kind": 1,
|
|
268
|
+
"detail": "Request decorator",
|
|
269
|
+
"documentation": { "value": "Injects the underlying platform request object (e.g., Express Request)." },
|
|
270
|
+
"insertText": "@Req() ${1:req}: Request",
|
|
271
|
+
"insertTextRules": 4,
|
|
272
|
+
"sortText": "01_@Req"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": "@Res",
|
|
276
|
+
"kind": 1,
|
|
277
|
+
"detail": "Response decorator",
|
|
278
|
+
"documentation": { "value": "Injects the underlying platform response object. Note: using @Res() disables NestJS standard response handling." },
|
|
279
|
+
"insertText": "@Res() ${1:res}: Response",
|
|
280
|
+
"insertTextRules": 4,
|
|
281
|
+
"sortText": "01_@Res"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"label": "@HttpCode",
|
|
285
|
+
"kind": 1,
|
|
286
|
+
"detail": "HTTP status code decorator",
|
|
287
|
+
"documentation": { "value": "Sets the HTTP response status code for the decorated route handler." },
|
|
288
|
+
"insertText": "@HttpCode(${1:200})",
|
|
289
|
+
"insertTextRules": 4,
|
|
290
|
+
"sortText": "01_@HttpCode"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"label": "@Header",
|
|
294
|
+
"kind": 1,
|
|
295
|
+
"detail": "Response header decorator",
|
|
296
|
+
"documentation": { "value": "Sets a custom response header for the decorated route handler." },
|
|
297
|
+
"insertText": "@Header('${1:key}', '${2:value}')",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "01_@Header"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": "@Redirect",
|
|
303
|
+
"kind": 1,
|
|
304
|
+
"detail": "Redirect decorator",
|
|
305
|
+
"documentation": { "value": "Redirects the response to the given URL with an optional status code." },
|
|
306
|
+
"insertText": "@Redirect('${1:url}', ${2:301})",
|
|
307
|
+
"insertTextRules": 4,
|
|
308
|
+
"sortText": "01_@Redirect"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"label": "@Render",
|
|
312
|
+
"kind": 1,
|
|
313
|
+
"detail": "Render decorator",
|
|
314
|
+
"documentation": { "value": "Renders a view template using the configured template engine (e.g., Handlebars, Pug)." },
|
|
315
|
+
"insertText": "@Render('${1:template}')",
|
|
316
|
+
"insertTextRules": 4,
|
|
317
|
+
"sortText": "01_@Render"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"label": "@UseGuards",
|
|
321
|
+
"kind": 1,
|
|
322
|
+
"detail": "Guards decorator",
|
|
323
|
+
"documentation": { "value": "Binds guards to the scope of the controller or method. Guards determine whether a request should be handled." },
|
|
324
|
+
"insertText": "@UseGuards(${1:AuthGuard})",
|
|
325
|
+
"insertTextRules": 4,
|
|
326
|
+
"sortText": "01_@UseGuards"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": "@UseInterceptors",
|
|
330
|
+
"kind": 1,
|
|
331
|
+
"detail": "Interceptors decorator",
|
|
332
|
+
"documentation": { "value": "Binds interceptors to the scope of the controller or method. Interceptors add extra logic before/after method execution." },
|
|
333
|
+
"insertText": "@UseInterceptors(${1:LoggingInterceptor})",
|
|
334
|
+
"insertTextRules": 4,
|
|
335
|
+
"sortText": "01_@UseInterceptors"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"label": "@UsePipes",
|
|
339
|
+
"kind": 1,
|
|
340
|
+
"detail": "Pipes decorator",
|
|
341
|
+
"documentation": { "value": "Binds pipes to the scope of the controller or method. Pipes transform or validate input data." },
|
|
342
|
+
"insertText": "@UsePipes(${1:ValidationPipe})",
|
|
343
|
+
"insertTextRules": 4,
|
|
344
|
+
"sortText": "01_@UsePipes"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"label": "@UseFilters",
|
|
348
|
+
"kind": 1,
|
|
349
|
+
"detail": "Filters decorator",
|
|
350
|
+
"documentation": { "value": "Binds exception filters to the scope of the controller or method." },
|
|
351
|
+
"insertText": "@UseFilters(${1:HttpExceptionFilter})",
|
|
352
|
+
"insertTextRules": 4,
|
|
353
|
+
"sortText": "01_@UseFilters"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"label": "@SetMetadata",
|
|
357
|
+
"kind": 1,
|
|
358
|
+
"detail": "Metadata decorator",
|
|
359
|
+
"documentation": { "value": "Attaches custom metadata to a route handler, accessible via Reflector." },
|
|
360
|
+
"insertText": "@SetMetadata('${1:key}', ${2:value})",
|
|
361
|
+
"insertTextRules": 4,
|
|
362
|
+
"sortText": "01_@SetMetadata"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": "@Catch",
|
|
366
|
+
"kind": 1,
|
|
367
|
+
"detail": "Catch decorator",
|
|
368
|
+
"documentation": { "value": "Marks a class as an exception filter for the given exception type(s)." },
|
|
369
|
+
"insertText": "@Catch(${1:HttpException})",
|
|
370
|
+
"insertTextRules": 4,
|
|
371
|
+
"sortText": "01_@Catch"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"label": "@EventPattern",
|
|
375
|
+
"kind": 1,
|
|
376
|
+
"detail": "Event pattern decorator",
|
|
377
|
+
"documentation": { "value": "Subscribes to an event-based microservice pattern (fire-and-forget)." },
|
|
378
|
+
"insertText": "@EventPattern('${1:event_name}')",
|
|
379
|
+
"insertTextRules": 4,
|
|
380
|
+
"sortText": "01_@EventPattern"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"label": "@MessagePattern",
|
|
384
|
+
"kind": 1,
|
|
385
|
+
"detail": "Message pattern decorator",
|
|
386
|
+
"documentation": { "value": "Subscribes to a request-response microservice message pattern." },
|
|
387
|
+
"insertText": "@MessagePattern('${1:pattern}')",
|
|
388
|
+
"insertTextRules": 4,
|
|
389
|
+
"sortText": "01_@MessagePattern"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"label": "@WebSocketGateway",
|
|
393
|
+
"kind": 1,
|
|
394
|
+
"detail": "WebSocket gateway decorator",
|
|
395
|
+
"documentation": { "value": "Marks a class as a WebSocket gateway. Accepts optional port and namespace options." },
|
|
396
|
+
"insertText": "@WebSocketGateway(${1:{ cors: { origin: '*' \\} \\}})",
|
|
397
|
+
"insertTextRules": 4,
|
|
398
|
+
"sortText": "01_@WebSocketGateway"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": "@SubscribeMessage",
|
|
402
|
+
"kind": 1,
|
|
403
|
+
"detail": "Subscribe message decorator",
|
|
404
|
+
"documentation": { "value": "Subscribes to a specific WebSocket message event." },
|
|
405
|
+
"insertText": "@SubscribeMessage('${1:event}')",
|
|
406
|
+
"insertTextRules": 4,
|
|
407
|
+
"sortText": "01_@SubscribeMessage"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"label": "@ConnectedSocket",
|
|
411
|
+
"kind": 1,
|
|
412
|
+
"detail": "Connected socket decorator",
|
|
413
|
+
"documentation": { "value": "Injects the connected client socket instance into a gateway method." },
|
|
414
|
+
"insertText": "@ConnectedSocket() ${1:client}: Socket",
|
|
415
|
+
"insertTextRules": 4,
|
|
416
|
+
"sortText": "01_@ConnectedSocket"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"label": "@WebSocketServer",
|
|
420
|
+
"kind": 1,
|
|
421
|
+
"detail": "WebSocket server decorator",
|
|
422
|
+
"documentation": { "value": "Injects the underlying WebSocket server instance." },
|
|
423
|
+
"insertText": "@WebSocketServer()\nserver: Server;",
|
|
424
|
+
"insertTextRules": 4,
|
|
425
|
+
"sortText": "01_@WebSocketServer"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"label": "@Sse",
|
|
429
|
+
"kind": 1,
|
|
430
|
+
"detail": "Server-Sent Events decorator",
|
|
431
|
+
"documentation": { "value": "Marks a method as a Server-Sent Events endpoint." },
|
|
432
|
+
"insertText": "@Sse('${1:sse}')",
|
|
433
|
+
"insertTextRules": 4,
|
|
434
|
+
"sortText": "01_@Sse"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"label": "@Cron",
|
|
438
|
+
"kind": 1,
|
|
439
|
+
"detail": "Cron job decorator",
|
|
440
|
+
"documentation": { "value": "Schedules a method to run on a cron expression using @nestjs/schedule." },
|
|
441
|
+
"insertText": "@Cron('${1:*/30 * * * * *}')",
|
|
442
|
+
"insertTextRules": 4,
|
|
443
|
+
"sortText": "01_@Cron"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"label": "@Interval",
|
|
447
|
+
"kind": 1,
|
|
448
|
+
"detail": "Interval decorator",
|
|
449
|
+
"documentation": { "value": "Schedules a method to run at a fixed interval in milliseconds." },
|
|
450
|
+
"insertText": "@Interval(${1:10000})",
|
|
451
|
+
"insertTextRules": 4,
|
|
452
|
+
"sortText": "01_@Interval"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": "@Timeout",
|
|
456
|
+
"kind": 1,
|
|
457
|
+
"detail": "Timeout decorator",
|
|
458
|
+
"documentation": { "value": "Schedules a method to run once after a timeout in milliseconds." },
|
|
459
|
+
"insertText": "@Timeout(${1:5000})",
|
|
460
|
+
"insertTextRules": 4,
|
|
461
|
+
"sortText": "01_@Timeout"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"label": "@ApiTags",
|
|
465
|
+
"kind": 1,
|
|
466
|
+
"detail": "Swagger API tags",
|
|
467
|
+
"documentation": { "value": "Adds tags to the Swagger documentation for grouping endpoints." },
|
|
468
|
+
"insertText": "@ApiTags('${1:tag}')",
|
|
469
|
+
"insertTextRules": 4,
|
|
470
|
+
"sortText": "01_@ApiTags"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"label": "@ApiOperation",
|
|
474
|
+
"kind": 1,
|
|
475
|
+
"detail": "Swagger API operation",
|
|
476
|
+
"documentation": { "value": "Describes an API operation for Swagger documentation." },
|
|
477
|
+
"insertText": "@ApiOperation({ summary: '${1:Description}' })",
|
|
478
|
+
"insertTextRules": 4,
|
|
479
|
+
"sortText": "01_@ApiOperation"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"label": "@ApiResponse",
|
|
483
|
+
"kind": 1,
|
|
484
|
+
"detail": "Swagger API response",
|
|
485
|
+
"documentation": { "value": "Documents an API response status code and description for Swagger." },
|
|
486
|
+
"insertText": "@ApiResponse({ status: ${1:200}, description: '${2:Success}' })",
|
|
487
|
+
"insertTextRules": 4,
|
|
488
|
+
"sortText": "01_@ApiResponse"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"label": "@ApiProperty",
|
|
492
|
+
"kind": 1,
|
|
493
|
+
"detail": "Swagger API property",
|
|
494
|
+
"documentation": { "value": "Decorates a DTO property for Swagger schema documentation." },
|
|
495
|
+
"insertText": "@ApiProperty({ description: '${1:Description}' })",
|
|
496
|
+
"insertTextRules": 4,
|
|
497
|
+
"sortText": "01_@ApiProperty"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": "@ApiBody",
|
|
501
|
+
"kind": 1,
|
|
502
|
+
"detail": "Swagger API body",
|
|
503
|
+
"documentation": { "value": "Describes the request body schema for Swagger documentation." },
|
|
504
|
+
"insertText": "@ApiBody({ type: ${1:CreateDto} })",
|
|
505
|
+
"insertTextRules": 4,
|
|
506
|
+
"sortText": "01_@ApiBody"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"label": "@ApiBearerAuth",
|
|
510
|
+
"kind": 1,
|
|
511
|
+
"detail": "Swagger Bearer Auth",
|
|
512
|
+
"documentation": { "value": "Marks an endpoint as requiring Bearer token authentication in Swagger." },
|
|
513
|
+
"insertText": "@ApiBearerAuth()",
|
|
514
|
+
"insertTextRules": 4,
|
|
515
|
+
"sortText": "01_@ApiBearerAuth"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"label": "@Payload",
|
|
519
|
+
"kind": 1,
|
|
520
|
+
"detail": "Microservice payload decorator",
|
|
521
|
+
"documentation": { "value": "Extracts the payload from a microservice message." },
|
|
522
|
+
"insertText": "@Payload() ${1:data}: ${2:any}",
|
|
523
|
+
"insertTextRules": 4,
|
|
524
|
+
"sortText": "01_@Payload"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": "@Ctx",
|
|
528
|
+
"kind": 1,
|
|
529
|
+
"detail": "Microservice context decorator",
|
|
530
|
+
"documentation": { "value": "Injects the microservice context object into a handler." },
|
|
531
|
+
"insertText": "@Ctx() ${1:context}",
|
|
532
|
+
"insertTextRules": 4,
|
|
533
|
+
"sortText": "01_@Ctx"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"label": "@Ip",
|
|
537
|
+
"kind": 1,
|
|
538
|
+
"detail": "IP address decorator",
|
|
539
|
+
"documentation": { "value": "Extracts the client IP address from the request." },
|
|
540
|
+
"insertText": "@Ip() ${1:ip}: string",
|
|
541
|
+
"insertTextRules": 4,
|
|
542
|
+
"sortText": "01_@Ip"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"label": "@Session",
|
|
546
|
+
"kind": 1,
|
|
547
|
+
"detail": "Session decorator",
|
|
548
|
+
"documentation": { "value": "Extracts the session object from the request." },
|
|
549
|
+
"insertText": "@Session() ${1:session}",
|
|
550
|
+
"insertTextRules": 4,
|
|
551
|
+
"sortText": "01_@Session"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"label": "@UploadedFile",
|
|
555
|
+
"kind": 1,
|
|
556
|
+
"detail": "Uploaded file decorator",
|
|
557
|
+
"documentation": { "value": "Extracts a single uploaded file from the request (used with FileInterceptor)." },
|
|
558
|
+
"insertText": "@UploadedFile() ${1:file}: Express.Multer.File",
|
|
559
|
+
"insertTextRules": 4,
|
|
560
|
+
"sortText": "01_@UploadedFile"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"label": "@UploadedFiles",
|
|
564
|
+
"kind": 1,
|
|
565
|
+
"detail": "Uploaded files decorator",
|
|
566
|
+
"documentation": { "value": "Extracts multiple uploaded files from the request (used with FilesInterceptor)." },
|
|
567
|
+
"insertText": "@UploadedFiles() ${1:files}: Express.Multer.File[]",
|
|
568
|
+
"insertTextRules": 4,
|
|
569
|
+
"sortText": "01_@UploadedFiles"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"label": "@Global",
|
|
573
|
+
"kind": 1,
|
|
574
|
+
"detail": "Global module decorator",
|
|
575
|
+
"documentation": { "value": "Makes a module global-scoped. Global modules are available everywhere without importing." },
|
|
576
|
+
"insertText": "@Global()",
|
|
577
|
+
"insertTextRules": 4,
|
|
578
|
+
"sortText": "01_@Global"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"label": "NestFactory",
|
|
582
|
+
"kind": 5,
|
|
583
|
+
"detail": "NestJS Application Factory",
|
|
584
|
+
"documentation": { "value": "Factory class to create a NestJS application instance. Provides create() and createMicroservice() methods." },
|
|
585
|
+
"insertText": "NestFactory",
|
|
586
|
+
"insertTextRules": 4,
|
|
587
|
+
"sortText": "02_NestFactory"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"label": "NestFactory.create",
|
|
591
|
+
"kind": 0,
|
|
592
|
+
"detail": "Create NestJS application",
|
|
593
|
+
"documentation": { "value": "Creates an instance of NestApplication from a root module." },
|
|
594
|
+
"insertText": "const app = await NestFactory.create(${1:AppModule});\nawait app.listen(${2:3000});",
|
|
595
|
+
"insertTextRules": 4,
|
|
596
|
+
"sortText": "02_NestFactory.create"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"label": "INestApplication",
|
|
600
|
+
"kind": 7,
|
|
601
|
+
"detail": "NestJS Application Interface",
|
|
602
|
+
"documentation": { "value": "Interface for the NestJS application instance. Provides methods like listen(), use(), useGlobalPipes(), etc." },
|
|
603
|
+
"insertText": "INestApplication",
|
|
604
|
+
"insertTextRules": 4,
|
|
605
|
+
"sortText": "02_INestApplication"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"label": "ModuleRef",
|
|
609
|
+
"kind": 5,
|
|
610
|
+
"detail": "Module Reference",
|
|
611
|
+
"documentation": { "value": "Provides access to the internal provider container for dynamic provider resolution." },
|
|
612
|
+
"insertText": "ModuleRef",
|
|
613
|
+
"insertTextRules": 4,
|
|
614
|
+
"sortText": "02_ModuleRef"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"label": "Reflector",
|
|
618
|
+
"kind": 5,
|
|
619
|
+
"detail": "Metadata Reflector",
|
|
620
|
+
"documentation": { "value": "Helper class to retrieve metadata set via @SetMetadata(). Used in guards and interceptors." },
|
|
621
|
+
"insertText": "Reflector",
|
|
622
|
+
"insertTextRules": 4,
|
|
623
|
+
"sortText": "02_Reflector"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"label": "HttpException",
|
|
627
|
+
"kind": 5,
|
|
628
|
+
"detail": "HTTP Exception",
|
|
629
|
+
"documentation": { "value": "Base class for HTTP exceptions. Accepts a response body and status code." },
|
|
630
|
+
"insertText": "throw new HttpException('${1:message}', HttpStatus.${2:BAD_REQUEST});",
|
|
631
|
+
"insertTextRules": 4,
|
|
632
|
+
"sortText": "02_HttpException"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"label": "HttpStatus",
|
|
636
|
+
"kind": 8,
|
|
637
|
+
"detail": "HTTP Status Codes Enum",
|
|
638
|
+
"documentation": { "value": "Enum of standard HTTP status codes (OK, CREATED, BAD_REQUEST, UNAUTHORIZED, etc.)." },
|
|
639
|
+
"insertText": "HttpStatus.${1:OK}",
|
|
640
|
+
"insertTextRules": 4,
|
|
641
|
+
"sortText": "02_HttpStatus"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"label": "BadRequestException",
|
|
645
|
+
"kind": 5,
|
|
646
|
+
"detail": "400 Bad Request",
|
|
647
|
+
"documentation": { "value": "Throws a 400 Bad Request HTTP exception." },
|
|
648
|
+
"insertText": "throw new BadRequestException('${1:message}');",
|
|
649
|
+
"insertTextRules": 4,
|
|
650
|
+
"sortText": "02_BadRequestException"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"label": "UnauthorizedException",
|
|
654
|
+
"kind": 5,
|
|
655
|
+
"detail": "401 Unauthorized",
|
|
656
|
+
"documentation": { "value": "Throws a 401 Unauthorized HTTP exception." },
|
|
657
|
+
"insertText": "throw new UnauthorizedException('${1:message}');",
|
|
658
|
+
"insertTextRules": 4,
|
|
659
|
+
"sortText": "02_UnauthorizedException"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"label": "ForbiddenException",
|
|
663
|
+
"kind": 5,
|
|
664
|
+
"detail": "403 Forbidden",
|
|
665
|
+
"documentation": { "value": "Throws a 403 Forbidden HTTP exception." },
|
|
666
|
+
"insertText": "throw new ForbiddenException('${1:message}');",
|
|
667
|
+
"insertTextRules": 4,
|
|
668
|
+
"sortText": "02_ForbiddenException"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"label": "NotFoundException",
|
|
672
|
+
"kind": 5,
|
|
673
|
+
"detail": "404 Not Found",
|
|
674
|
+
"documentation": { "value": "Throws a 404 Not Found HTTP exception." },
|
|
675
|
+
"insertText": "throw new NotFoundException('${1:message}');",
|
|
676
|
+
"insertTextRules": 4,
|
|
677
|
+
"sortText": "02_NotFoundException"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"label": "ConflictException",
|
|
681
|
+
"kind": 5,
|
|
682
|
+
"detail": "409 Conflict",
|
|
683
|
+
"documentation": { "value": "Throws a 409 Conflict HTTP exception." },
|
|
684
|
+
"insertText": "throw new ConflictException('${1:message}');",
|
|
685
|
+
"insertTextRules": 4,
|
|
686
|
+
"sortText": "02_ConflictException"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"label": "InternalServerErrorException",
|
|
690
|
+
"kind": 5,
|
|
691
|
+
"detail": "500 Internal Server Error",
|
|
692
|
+
"documentation": { "value": "Throws a 500 Internal Server Error HTTP exception." },
|
|
693
|
+
"insertText": "throw new InternalServerErrorException('${1:message}');",
|
|
694
|
+
"insertTextRules": 4,
|
|
695
|
+
"sortText": "02_InternalServerErrorException"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": "NotImplementedException",
|
|
699
|
+
"kind": 5,
|
|
700
|
+
"detail": "501 Not Implemented",
|
|
701
|
+
"documentation": { "value": "Throws a 501 Not Implemented HTTP exception." },
|
|
702
|
+
"insertText": "throw new NotImplementedException('${1:message}');",
|
|
703
|
+
"insertTextRules": 4,
|
|
704
|
+
"sortText": "02_NotImplementedException"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"label": "GoneException",
|
|
708
|
+
"kind": 5,
|
|
709
|
+
"detail": "410 Gone",
|
|
710
|
+
"documentation": { "value": "Throws a 410 Gone HTTP exception." },
|
|
711
|
+
"insertText": "throw new GoneException('${1:message}');",
|
|
712
|
+
"insertTextRules": 4,
|
|
713
|
+
"sortText": "02_GoneException"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"label": "PayloadTooLargeException",
|
|
717
|
+
"kind": 5,
|
|
718
|
+
"detail": "413 Payload Too Large",
|
|
719
|
+
"documentation": { "value": "Throws a 413 Payload Too Large HTTP exception." },
|
|
720
|
+
"insertText": "throw new PayloadTooLargeException('${1:message}');",
|
|
721
|
+
"insertTextRules": 4,
|
|
722
|
+
"sortText": "02_PayloadTooLargeException"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"label": "UnprocessableEntityException",
|
|
726
|
+
"kind": 5,
|
|
727
|
+
"detail": "422 Unprocessable Entity",
|
|
728
|
+
"documentation": { "value": "Throws a 422 Unprocessable Entity HTTP exception." },
|
|
729
|
+
"insertText": "throw new UnprocessableEntityException('${1:message}');",
|
|
730
|
+
"insertTextRules": 4,
|
|
731
|
+
"sortText": "02_UnprocessableEntityException"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"label": "ServiceUnavailableException",
|
|
735
|
+
"kind": 5,
|
|
736
|
+
"detail": "503 Service Unavailable",
|
|
737
|
+
"documentation": { "value": "Throws a 503 Service Unavailable HTTP exception." },
|
|
738
|
+
"insertText": "throw new ServiceUnavailableException('${1:message}');",
|
|
739
|
+
"insertTextRules": 4,
|
|
740
|
+
"sortText": "02_ServiceUnavailableException"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"label": "Test.createTestingModule",
|
|
744
|
+
"kind": 0,
|
|
745
|
+
"detail": "Create Testing Module",
|
|
746
|
+
"documentation": { "value": "Creates a testing module for unit and integration tests with NestJS." },
|
|
747
|
+
"insertText": "const module: TestingModule = await Test.createTestingModule({\n ${1:providers: []}\n}).compile();",
|
|
748
|
+
"insertTextRules": 4,
|
|
749
|
+
"sortText": "02_Test.createTestingModule"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"label": "TestingModule",
|
|
753
|
+
"kind": 5,
|
|
754
|
+
"detail": "NestJS Testing Module",
|
|
755
|
+
"documentation": { "value": "Compiled testing module that provides get() and resolve() methods for retrieving providers." },
|
|
756
|
+
"insertText": "TestingModule",
|
|
757
|
+
"insertTextRules": 4,
|
|
758
|
+
"sortText": "02_TestingModule"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"label": "ExecutionContext",
|
|
762
|
+
"kind": 7,
|
|
763
|
+
"detail": "Execution Context",
|
|
764
|
+
"documentation": { "value": "Extends ArgumentsHost with helper methods to determine the current handler and class being invoked." },
|
|
765
|
+
"insertText": "ExecutionContext",
|
|
766
|
+
"insertTextRules": 4,
|
|
767
|
+
"sortText": "02_ExecutionContext"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"label": "ArgumentsHost",
|
|
771
|
+
"kind": 7,
|
|
772
|
+
"detail": "Arguments Host",
|
|
773
|
+
"documentation": { "value": "Provides methods to retrieve arguments for HTTP, WebSocket, or RPC contexts." },
|
|
774
|
+
"insertText": "ArgumentsHost",
|
|
775
|
+
"insertTextRules": 4,
|
|
776
|
+
"sortText": "02_ArgumentsHost"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"label": "Logger",
|
|
780
|
+
"kind": 5,
|
|
781
|
+
"detail": "NestJS Logger",
|
|
782
|
+
"documentation": { "value": "Built-in logger service with log levels: log, error, warn, debug, verbose." },
|
|
783
|
+
"insertText": "private readonly logger = new Logger(${1:this.constructor.name});",
|
|
784
|
+
"insertTextRules": 4,
|
|
785
|
+
"sortText": "02_Logger"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"label": "ConfigModule",
|
|
789
|
+
"kind": 8,
|
|
790
|
+
"detail": "Configuration Module",
|
|
791
|
+
"documentation": { "value": "Module for loading environment variables and configuration. Provides ConfigService for accessing values." },
|
|
792
|
+
"insertText": "ConfigModule.forRoot({\n isGlobal: true,\n envFilePath: '${1:.env}',\n})",
|
|
793
|
+
"insertTextRules": 4,
|
|
794
|
+
"sortText": "03_ConfigModule"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"label": "ConfigService",
|
|
798
|
+
"kind": 5,
|
|
799
|
+
"detail": "Configuration Service",
|
|
800
|
+
"documentation": { "value": "Service to access configuration values loaded by ConfigModule. Use get() to retrieve values." },
|
|
801
|
+
"insertText": "this.configService.get<${1:string}>('${2:KEY}')",
|
|
802
|
+
"insertTextRules": 4,
|
|
803
|
+
"sortText": "03_ConfigService"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"label": "TypeOrmModule",
|
|
807
|
+
"kind": 8,
|
|
808
|
+
"detail": "TypeORM Module",
|
|
809
|
+
"documentation": { "value": "Module for integrating TypeORM with NestJS. Provides forRoot() and forFeature() methods." },
|
|
810
|
+
"insertText": "TypeOrmModule.forRoot({\n type: '${1:postgres}',\n host: '${2:localhost}',\n port: ${3:5432},\n username: '${4:user}',\n password: '${5:password}',\n database: '${6:db}',\n entities: [${7}],\n synchronize: ${8:false},\n})",
|
|
811
|
+
"insertTextRules": 4,
|
|
812
|
+
"sortText": "03_TypeOrmModule"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"label": "TypeOrmModule.forFeature",
|
|
816
|
+
"kind": 0,
|
|
817
|
+
"detail": "TypeORM Feature Module",
|
|
818
|
+
"documentation": { "value": "Registers TypeORM repositories for the given entities in the current module scope." },
|
|
819
|
+
"insertText": "TypeOrmModule.forFeature([${1:Entity}])",
|
|
820
|
+
"insertTextRules": 4,
|
|
821
|
+
"sortText": "03_TypeOrmModule.forFeature"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"label": "MongooseModule",
|
|
825
|
+
"kind": 8,
|
|
826
|
+
"detail": "Mongoose Module",
|
|
827
|
+
"documentation": { "value": "Module for integrating Mongoose ODM with NestJS. Provides forRoot() and forFeature() methods." },
|
|
828
|
+
"insertText": "MongooseModule.forRoot('${1:mongodb://localhost/nest}')",
|
|
829
|
+
"insertTextRules": 4,
|
|
830
|
+
"sortText": "03_MongooseModule"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"label": "MongooseModule.forFeature",
|
|
834
|
+
"kind": 0,
|
|
835
|
+
"detail": "Mongoose Feature Module",
|
|
836
|
+
"documentation": { "value": "Registers Mongoose schemas for the given models in the current module scope." },
|
|
837
|
+
"insertText": "MongooseModule.forFeature([{ name: ${1:Model}.name, schema: ${1:Model}Schema }])",
|
|
838
|
+
"insertTextRules": 4,
|
|
839
|
+
"sortText": "03_MongooseModule.forFeature"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"label": "JwtModule",
|
|
843
|
+
"kind": 8,
|
|
844
|
+
"detail": "JWT Module",
|
|
845
|
+
"documentation": { "value": "Module for JWT token generation and verification using @nestjs/jwt." },
|
|
846
|
+
"insertText": "JwtModule.register({\n secret: '${1:secret}',\n signOptions: { expiresIn: '${2:60s}' },\n})",
|
|
847
|
+
"insertTextRules": 4,
|
|
848
|
+
"sortText": "03_JwtModule"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"label": "PassportModule",
|
|
852
|
+
"kind": 8,
|
|
853
|
+
"detail": "Passport Module",
|
|
854
|
+
"documentation": { "value": "Module for integrating Passport.js authentication strategies with NestJS." },
|
|
855
|
+
"insertText": "PassportModule.register({ defaultStrategy: '${1:jwt}' })",
|
|
856
|
+
"insertTextRules": 4,
|
|
857
|
+
"sortText": "03_PassportModule"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"label": "ThrottlerModule",
|
|
861
|
+
"kind": 8,
|
|
862
|
+
"detail": "Throttler Module",
|
|
863
|
+
"documentation": { "value": "Rate limiting module to protect endpoints from brute-force attacks." },
|
|
864
|
+
"insertText": "ThrottlerModule.forRoot([{\n ttl: ${1:60000},\n limit: ${2:10},\n}])",
|
|
865
|
+
"insertTextRules": 4,
|
|
866
|
+
"sortText": "03_ThrottlerModule"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"label": "CacheModule",
|
|
870
|
+
"kind": 8,
|
|
871
|
+
"detail": "Cache Module",
|
|
872
|
+
"documentation": { "value": "Module for caching responses. Supports in-memory and external stores like Redis." },
|
|
873
|
+
"insertText": "CacheModule.register({\n ttl: ${1:5},\n max: ${2:10},\n})",
|
|
874
|
+
"insertTextRules": 4,
|
|
875
|
+
"sortText": "03_CacheModule"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"label": "ScheduleModule",
|
|
879
|
+
"kind": 8,
|
|
880
|
+
"detail": "Schedule Module",
|
|
881
|
+
"documentation": { "value": "Module for task scheduling using cron jobs, intervals, and timeouts." },
|
|
882
|
+
"insertText": "ScheduleModule.forRoot()",
|
|
883
|
+
"insertTextRules": 4,
|
|
884
|
+
"sortText": "03_ScheduleModule"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"label": "BullModule",
|
|
888
|
+
"kind": 8,
|
|
889
|
+
"detail": "Bull Queue Module",
|
|
890
|
+
"documentation": { "value": "Module for queue management using Bull and Redis for background job processing." },
|
|
891
|
+
"insertText": "BullModule.forRoot({\n redis: {\n host: '${1:localhost}',\n port: ${2:6379},\n },\n})",
|
|
892
|
+
"insertTextRules": 4,
|
|
893
|
+
"sortText": "03_BullModule"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"label": "EventEmitterModule",
|
|
897
|
+
"kind": 8,
|
|
898
|
+
"detail": "Event Emitter Module",
|
|
899
|
+
"documentation": { "value": "Module for event-driven architecture using Node.js EventEmitter." },
|
|
900
|
+
"insertText": "EventEmitterModule.forRoot()",
|
|
901
|
+
"insertTextRules": 4,
|
|
902
|
+
"sortText": "03_EventEmitterModule"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"label": "ServeStaticModule",
|
|
906
|
+
"kind": 8,
|
|
907
|
+
"detail": "Serve Static Module",
|
|
908
|
+
"documentation": { "value": "Module for serving static files (SPA, assets) from a directory." },
|
|
909
|
+
"insertText": "ServeStaticModule.forRoot({\n rootPath: join(__dirname, '..', '${1:client}'),\n})",
|
|
910
|
+
"insertTextRules": 4,
|
|
911
|
+
"sortText": "03_ServeStaticModule"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"label": "GraphQLModule",
|
|
915
|
+
"kind": 8,
|
|
916
|
+
"detail": "GraphQL Module",
|
|
917
|
+
"documentation": { "value": "Module for integrating GraphQL with NestJS. Supports code-first and schema-first approaches." },
|
|
918
|
+
"insertText": "GraphQLModule.forRoot<ApolloDriverConfig>({\n driver: ApolloDriver,\n autoSchemaFile: join(process.cwd(), 'src/schema.gql'),\n})",
|
|
919
|
+
"insertTextRules": 4,
|
|
920
|
+
"sortText": "03_GraphQLModule"
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"label": "AuthGuard",
|
|
924
|
+
"kind": 5,
|
|
925
|
+
"detail": "Passport Auth Guard",
|
|
926
|
+
"documentation": { "value": "Guard that triggers Passport authentication for a given strategy (e.g., 'jwt', 'local')." },
|
|
927
|
+
"insertText": "AuthGuard('${1:jwt}')",
|
|
928
|
+
"insertTextRules": 4,
|
|
929
|
+
"sortText": "04_AuthGuard"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"label": "ValidationPipe",
|
|
933
|
+
"kind": 5,
|
|
934
|
+
"detail": "Validation Pipe",
|
|
935
|
+
"documentation": { "value": "Pipe that validates incoming data using class-validator decorators. Supports whitelist, transform, and forbidNonWhitelisted." },
|
|
936
|
+
"insertText": "new ValidationPipe({\n whitelist: true,\n transform: true,\n forbidNonWhitelisted: true,\n})",
|
|
937
|
+
"insertTextRules": 4,
|
|
938
|
+
"sortText": "04_ValidationPipe"
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"label": "ParseIntPipe",
|
|
942
|
+
"kind": 5,
|
|
943
|
+
"detail": "Parse Int Pipe",
|
|
944
|
+
"documentation": { "value": "Pipe that transforms a string parameter into an integer. Throws BadRequestException on failure." },
|
|
945
|
+
"insertText": "ParseIntPipe",
|
|
946
|
+
"insertTextRules": 4,
|
|
947
|
+
"sortText": "04_ParseIntPipe"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
"label": "ParseBoolPipe",
|
|
951
|
+
"kind": 5,
|
|
952
|
+
"detail": "Parse Bool Pipe",
|
|
953
|
+
"documentation": { "value": "Pipe that transforms a string parameter into a boolean." },
|
|
954
|
+
"insertText": "ParseBoolPipe",
|
|
955
|
+
"insertTextRules": 4,
|
|
956
|
+
"sortText": "04_ParseBoolPipe"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"label": "ParseArrayPipe",
|
|
960
|
+
"kind": 5,
|
|
961
|
+
"detail": "Parse Array Pipe",
|
|
962
|
+
"documentation": { "value": "Pipe that parses and validates arrays. Supports item type validation." },
|
|
963
|
+
"insertText": "new ParseArrayPipe({ items: ${1:Number} })",
|
|
964
|
+
"insertTextRules": 4,
|
|
965
|
+
"sortText": "04_ParseArrayPipe"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
"label": "ParseUUIDPipe",
|
|
969
|
+
"kind": 5,
|
|
970
|
+
"detail": "Parse UUID Pipe",
|
|
971
|
+
"documentation": { "value": "Pipe that validates and parses UUID parameters." },
|
|
972
|
+
"insertText": "ParseUUIDPipe",
|
|
973
|
+
"insertTextRules": 4,
|
|
974
|
+
"sortText": "04_ParseUUIDPipe"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"label": "ParseEnumPipe",
|
|
978
|
+
"kind": 5,
|
|
979
|
+
"detail": "Parse Enum Pipe",
|
|
980
|
+
"documentation": { "value": "Pipe that validates a parameter is a valid enum value." },
|
|
981
|
+
"insertText": "new ParseEnumPipe(${1:MyEnum})",
|
|
982
|
+
"insertTextRules": 4,
|
|
983
|
+
"sortText": "04_ParseEnumPipe"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"label": "DefaultValuePipe",
|
|
987
|
+
"kind": 5,
|
|
988
|
+
"detail": "Default Value Pipe",
|
|
989
|
+
"documentation": { "value": "Pipe that provides a default value when the parameter is null or undefined." },
|
|
990
|
+
"insertText": "new DefaultValuePipe(${1:0})",
|
|
991
|
+
"insertTextRules": 4,
|
|
992
|
+
"sortText": "04_DefaultValuePipe"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"label": "ParseFloatPipe",
|
|
996
|
+
"kind": 5,
|
|
997
|
+
"detail": "Parse Float Pipe",
|
|
998
|
+
"documentation": { "value": "Pipe that transforms a string parameter into a floating-point number." },
|
|
999
|
+
"insertText": "ParseFloatPipe",
|
|
1000
|
+
"insertTextRules": 4,
|
|
1001
|
+
"sortText": "04_ParseFloatPipe"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"label": "ClassSerializerInterceptor",
|
|
1005
|
+
"kind": 5,
|
|
1006
|
+
"detail": "Class Serializer Interceptor",
|
|
1007
|
+
"documentation": { "value": "Interceptor that serializes response objects using class-transformer. Respects @Exclude() and @Expose() decorators." },
|
|
1008
|
+
"insertText": "ClassSerializerInterceptor",
|
|
1009
|
+
"insertTextRules": 4,
|
|
1010
|
+
"sortText": "04_ClassSerializerInterceptor"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"label": "CacheInterceptor",
|
|
1014
|
+
"kind": 5,
|
|
1015
|
+
"detail": "Cache Interceptor",
|
|
1016
|
+
"documentation": { "value": "Interceptor that automatically caches responses. Works with CacheModule." },
|
|
1017
|
+
"insertText": "CacheInterceptor",
|
|
1018
|
+
"insertTextRules": 4,
|
|
1019
|
+
"sortText": "04_CacheInterceptor"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"label": "FileInterceptor",
|
|
1023
|
+
"kind": 5,
|
|
1024
|
+
"detail": "File Upload Interceptor",
|
|
1025
|
+
"documentation": { "value": "Interceptor for handling single file uploads via multipart/form-data using Multer." },
|
|
1026
|
+
"insertText": "FileInterceptor('${1:file}')",
|
|
1027
|
+
"insertTextRules": 4,
|
|
1028
|
+
"sortText": "04_FileInterceptor"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
"label": "FilesInterceptor",
|
|
1032
|
+
"kind": 5,
|
|
1033
|
+
"detail": "Multiple Files Interceptor",
|
|
1034
|
+
"documentation": { "value": "Interceptor for handling multiple file uploads via multipart/form-data using Multer." },
|
|
1035
|
+
"insertText": "FilesInterceptor('${1:files}', ${2:10})",
|
|
1036
|
+
"insertTextRules": 4,
|
|
1037
|
+
"sortText": "04_FilesInterceptor"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"label": "nest new",
|
|
1041
|
+
"kind": 17,
|
|
1042
|
+
"detail": "Create new NestJS project",
|
|
1043
|
+
"documentation": { "value": "Scaffolds a new NestJS project with the CLI. Usage: nest new project-name" },
|
|
1044
|
+
"insertText": "nest new ${1:project-name}",
|
|
1045
|
+
"insertTextRules": 4,
|
|
1046
|
+
"sortText": "05_nest_new"
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"label": "nest generate controller",
|
|
1050
|
+
"kind": 17,
|
|
1051
|
+
"detail": "Generate controller",
|
|
1052
|
+
"documentation": { "value": "Generates a new NestJS controller with the CLI." },
|
|
1053
|
+
"insertText": "nest generate controller ${1:name}",
|
|
1054
|
+
"insertTextRules": 4,
|
|
1055
|
+
"sortText": "05_nest_generate_controller"
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"label": "nest generate service",
|
|
1059
|
+
"kind": 17,
|
|
1060
|
+
"detail": "Generate service",
|
|
1061
|
+
"documentation": { "value": "Generates a new NestJS service with the CLI." },
|
|
1062
|
+
"insertText": "nest generate service ${1:name}",
|
|
1063
|
+
"insertTextRules": 4,
|
|
1064
|
+
"sortText": "05_nest_generate_service"
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
"label": "nest generate module",
|
|
1068
|
+
"kind": 17,
|
|
1069
|
+
"detail": "Generate module",
|
|
1070
|
+
"documentation": { "value": "Generates a new NestJS module with the CLI." },
|
|
1071
|
+
"insertText": "nest generate module ${1:name}",
|
|
1072
|
+
"insertTextRules": 4,
|
|
1073
|
+
"sortText": "05_nest_generate_module"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
"label": "nest generate resource",
|
|
1077
|
+
"kind": 17,
|
|
1078
|
+
"detail": "Generate CRUD resource",
|
|
1079
|
+
"documentation": { "value": "Generates a complete CRUD resource (module, controller, service, DTOs, entities)." },
|
|
1080
|
+
"insertText": "nest generate resource ${1:name}",
|
|
1081
|
+
"insertTextRules": 4,
|
|
1082
|
+
"sortText": "05_nest_generate_resource"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
"label": "nest build",
|
|
1086
|
+
"kind": 17,
|
|
1087
|
+
"detail": "Build NestJS project",
|
|
1088
|
+
"documentation": { "value": "Compiles the NestJS application." },
|
|
1089
|
+
"insertText": "nest build",
|
|
1090
|
+
"insertTextRules": 4,
|
|
1091
|
+
"sortText": "05_nest_build"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
"label": "nest start",
|
|
1095
|
+
"kind": 17,
|
|
1096
|
+
"detail": "Start NestJS application",
|
|
1097
|
+
"documentation": { "value": "Compiles and runs the NestJS application." },
|
|
1098
|
+
"insertText": "nest start --watch",
|
|
1099
|
+
"insertTextRules": 4,
|
|
1100
|
+
"sortText": "05_nest_start"
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
"label": "app.useGlobalPipes",
|
|
1104
|
+
"kind": 0,
|
|
1105
|
+
"detail": "Set global validation pipe",
|
|
1106
|
+
"documentation": { "value": "Applies a pipe globally to every route handler in the application." },
|
|
1107
|
+
"insertText": "app.useGlobalPipes(new ValidationPipe({\n whitelist: true,\n transform: true,\n forbidNonWhitelisted: true,\n}));",
|
|
1108
|
+
"insertTextRules": 4,
|
|
1109
|
+
"sortText": "02_app.useGlobalPipes"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
"label": "app.useGlobalFilters",
|
|
1113
|
+
"kind": 0,
|
|
1114
|
+
"detail": "Set global exception filter",
|
|
1115
|
+
"documentation": { "value": "Applies an exception filter globally to every route handler." },
|
|
1116
|
+
"insertText": "app.useGlobalFilters(new ${1:HttpExceptionFilter}());",
|
|
1117
|
+
"insertTextRules": 4,
|
|
1118
|
+
"sortText": "02_app.useGlobalFilters"
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
"label": "app.useGlobalGuards",
|
|
1122
|
+
"kind": 0,
|
|
1123
|
+
"detail": "Set global guard",
|
|
1124
|
+
"documentation": { "value": "Applies a guard globally to every route handler." },
|
|
1125
|
+
"insertText": "app.useGlobalGuards(new ${1:AuthGuard}());",
|
|
1126
|
+
"insertTextRules": 4,
|
|
1127
|
+
"sortText": "02_app.useGlobalGuards"
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
"label": "app.useGlobalInterceptors",
|
|
1131
|
+
"kind": 0,
|
|
1132
|
+
"detail": "Set global interceptor",
|
|
1133
|
+
"documentation": { "value": "Applies an interceptor globally to every route handler." },
|
|
1134
|
+
"insertText": "app.useGlobalInterceptors(new ${1:TransformInterceptor}());",
|
|
1135
|
+
"insertTextRules": 4,
|
|
1136
|
+
"sortText": "02_app.useGlobalInterceptors"
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
"label": "app.enableCors",
|
|
1140
|
+
"kind": 0,
|
|
1141
|
+
"detail": "Enable CORS",
|
|
1142
|
+
"documentation": { "value": "Enables Cross-Origin Resource Sharing on the NestJS application." },
|
|
1143
|
+
"insertText": "app.enableCors({\n origin: '${1:http://localhost:3000}',\n methods: '${2:GET,HEAD,PUT,PATCH,POST,DELETE}',\n credentials: ${3:true},\n});",
|
|
1144
|
+
"insertTextRules": 4,
|
|
1145
|
+
"sortText": "02_app.enableCors"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
"label": "app.setGlobalPrefix",
|
|
1149
|
+
"kind": 0,
|
|
1150
|
+
"detail": "Set global route prefix",
|
|
1151
|
+
"documentation": { "value": "Sets a prefix for every HTTP route registered in the application (e.g., 'api')." },
|
|
1152
|
+
"insertText": "app.setGlobalPrefix('${1:api}');",
|
|
1153
|
+
"insertTextRules": 4,
|
|
1154
|
+
"sortText": "02_app.setGlobalPrefix"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
"label": "app.enableVersioning",
|
|
1158
|
+
"kind": 0,
|
|
1159
|
+
"detail": "Enable API versioning",
|
|
1160
|
+
"documentation": { "value": "Enables URI, header, or media-type based API versioning." },
|
|
1161
|
+
"insertText": "app.enableVersioning({\n type: VersioningType.${1:URI},\n});",
|
|
1162
|
+
"insertTextRules": 4,
|
|
1163
|
+
"sortText": "02_app.enableVersioning"
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
"label": "SwaggerModule.setup",
|
|
1167
|
+
"kind": 0,
|
|
1168
|
+
"detail": "Setup Swagger documentation",
|
|
1169
|
+
"documentation": { "value": "Sets up Swagger UI documentation endpoint for the NestJS application." },
|
|
1170
|
+
"insertText": "const config = new DocumentBuilder()\n .setTitle('${1:API}')\n .setDescription('${2:API description}')\n .setVersion('${3:1.0}')\n .addBearerAuth()\n .build();\nconst document = SwaggerModule.createDocument(app, config);\nSwaggerModule.setup('${4:api}', app, document);",
|
|
1171
|
+
"insertTextRules": 4,
|
|
1172
|
+
"sortText": "02_SwaggerModule.setup"
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
"label": "onModuleInit",
|
|
1176
|
+
"kind": 0,
|
|
1177
|
+
"detail": "OnModuleInit lifecycle hook",
|
|
1178
|
+
"documentation": { "value": "Lifecycle hook called once the host module's dependencies have been resolved." },
|
|
1179
|
+
"insertText": "async onModuleInit() {\n ${0}\n}",
|
|
1180
|
+
"insertTextRules": 4,
|
|
1181
|
+
"sortText": "02_onModuleInit"
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
"label": "onModuleDestroy",
|
|
1185
|
+
"kind": 0,
|
|
1186
|
+
"detail": "OnModuleDestroy lifecycle hook",
|
|
1187
|
+
"documentation": { "value": "Lifecycle hook called when the host module is being destroyed." },
|
|
1188
|
+
"insertText": "async onModuleDestroy() {\n ${0}\n}",
|
|
1189
|
+
"insertTextRules": 4,
|
|
1190
|
+
"sortText": "02_onModuleDestroy"
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
"label": "onApplicationBootstrap",
|
|
1194
|
+
"kind": 0,
|
|
1195
|
+
"detail": "OnApplicationBootstrap lifecycle hook",
|
|
1196
|
+
"documentation": { "value": "Lifecycle hook called once all modules have been initialized." },
|
|
1197
|
+
"insertText": "async onApplicationBootstrap() {\n ${0}\n}",
|
|
1198
|
+
"insertTextRules": 4,
|
|
1199
|
+
"sortText": "02_onApplicationBootstrap"
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
"label": "onApplicationShutdown",
|
|
1203
|
+
"kind": 0,
|
|
1204
|
+
"detail": "OnApplicationShutdown lifecycle hook",
|
|
1205
|
+
"documentation": { "value": "Lifecycle hook called after app.close() is invoked. Receives the signal string." },
|
|
1206
|
+
"insertText": "async onApplicationShutdown(signal?: string) {\n ${0}\n}",
|
|
1207
|
+
"insertTextRules": 4,
|
|
1208
|
+
"sortText": "02_onApplicationShutdown"
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
"label": "beforeApplicationShutdown",
|
|
1212
|
+
"kind": 0,
|
|
1213
|
+
"detail": "BeforeApplicationShutdown lifecycle hook",
|
|
1214
|
+
"documentation": { "value": "Lifecycle hook called before the application shutdown sequence. Connections are still open." },
|
|
1215
|
+
"insertText": "async beforeApplicationShutdown(signal?: string) {\n ${0}\n}",
|
|
1216
|
+
"insertTextRules": 4,
|
|
1217
|
+
"sortText": "02_beforeApplicationShutdown"
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
"label": "@InjectRepository",
|
|
1221
|
+
"kind": 1,
|
|
1222
|
+
"detail": "TypeORM repository injection",
|
|
1223
|
+
"documentation": { "value": "Injects a TypeORM repository for the given entity into a constructor parameter." },
|
|
1224
|
+
"insertText": "@InjectRepository(${1:Entity}) private readonly ${2:repo}: Repository<${1:Entity}>",
|
|
1225
|
+
"insertTextRules": 4,
|
|
1226
|
+
"sortText": "01_@InjectRepository"
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
"label": "@InjectModel",
|
|
1230
|
+
"kind": 1,
|
|
1231
|
+
"detail": "Mongoose model injection",
|
|
1232
|
+
"documentation": { "value": "Injects a Mongoose model for the given schema into a constructor parameter." },
|
|
1233
|
+
"insertText": "@InjectModel(${1:Model}.name) private ${2:model}: Model<${1:Model}Document>",
|
|
1234
|
+
"insertTextRules": 4,
|
|
1235
|
+
"sortText": "01_@InjectModel"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
"label": "JwtService",
|
|
1239
|
+
"kind": 5,
|
|
1240
|
+
"detail": "JWT Service",
|
|
1241
|
+
"documentation": { "value": "Service for signing and verifying JWT tokens. Provided by JwtModule." },
|
|
1242
|
+
"insertText": "JwtService",
|
|
1243
|
+
"insertTextRules": 4,
|
|
1244
|
+
"sortText": "02_JwtService"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
"label": "HttpService",
|
|
1248
|
+
"kind": 5,
|
|
1249
|
+
"detail": "HTTP Service",
|
|
1250
|
+
"documentation": { "value": "Service for making HTTP requests using Axios. Provided by HttpModule." },
|
|
1251
|
+
"insertText": "HttpService",
|
|
1252
|
+
"insertTextRules": 4,
|
|
1253
|
+
"sortText": "02_HttpService"
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
"label": "HttpModule",
|
|
1257
|
+
"kind": 8,
|
|
1258
|
+
"detail": "HTTP Module",
|
|
1259
|
+
"documentation": { "value": "Module that exposes HttpService for making external HTTP requests via Axios." },
|
|
1260
|
+
"insertText": "HttpModule.register({\n timeout: ${1:5000},\n maxRedirects: ${2:5},\n})",
|
|
1261
|
+
"insertTextRules": 4,
|
|
1262
|
+
"sortText": "03_HttpModule"
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
"label": "TerminusModule",
|
|
1266
|
+
"kind": 8,
|
|
1267
|
+
"detail": "Health Check Module",
|
|
1268
|
+
"documentation": { "value": "Module for implementing health check endpoints using @nestjs/terminus." },
|
|
1269
|
+
"insertText": "TerminusModule",
|
|
1270
|
+
"insertTextRules": 4,
|
|
1271
|
+
"sortText": "03_TerminusModule"
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
"label": "MicroserviceOptions",
|
|
1275
|
+
"kind": 7,
|
|
1276
|
+
"detail": "Microservice Options",
|
|
1277
|
+
"documentation": { "value": "Configuration options for NestJS microservices (transport, options, etc.)." },
|
|
1278
|
+
"insertText": "MicroserviceOptions",
|
|
1279
|
+
"insertTextRules": 4,
|
|
1280
|
+
"sortText": "02_MicroserviceOptions"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
"label": "Transport",
|
|
1284
|
+
"kind": 8,
|
|
1285
|
+
"detail": "Transport Enum",
|
|
1286
|
+
"documentation": { "value": "Enum of microservice transport layers: TCP, REDIS, NATS, MQTT, gRPC, KAFKA, RMQ." },
|
|
1287
|
+
"insertText": "Transport.${1:TCP}",
|
|
1288
|
+
"insertTextRules": 4,
|
|
1289
|
+
"sortText": "02_Transport"
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
"label": "ClientProxy",
|
|
1293
|
+
"kind": 5,
|
|
1294
|
+
"detail": "Microservice Client Proxy",
|
|
1295
|
+
"documentation": { "value": "Proxy class for sending messages to other microservices." },
|
|
1296
|
+
"insertText": "ClientProxy",
|
|
1297
|
+
"insertTextRules": 4,
|
|
1298
|
+
"sortText": "02_ClientProxy"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"label": "ClientsModule",
|
|
1302
|
+
"kind": 8,
|
|
1303
|
+
"detail": "Microservice Clients Module",
|
|
1304
|
+
"documentation": { "value": "Module for registering microservice client connections." },
|
|
1305
|
+
"insertText": "ClientsModule.register([\n {\n name: '${1:SERVICE_NAME}',\n transport: Transport.${2:TCP},\n options: {\n host: '${3:localhost}',\n port: ${4:3001},\n },\n },\n])",
|
|
1306
|
+
"insertTextRules": 4,
|
|
1307
|
+
"sortText": "03_ClientsModule"
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
"label": "VersioningType",
|
|
1311
|
+
"kind": 8,
|
|
1312
|
+
"detail": "API Versioning Type",
|
|
1313
|
+
"documentation": { "value": "Enum for API versioning strategies: URI, HEADER, MEDIA_TYPE, CUSTOM." },
|
|
1314
|
+
"insertText": "VersioningType.${1:URI}",
|
|
1315
|
+
"insertTextRules": 4,
|
|
1316
|
+
"sortText": "02_VersioningType"
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
"label": "@Version",
|
|
1320
|
+
"kind": 1,
|
|
1321
|
+
"detail": "API version decorator",
|
|
1322
|
+
"documentation": { "value": "Sets the API version for a controller or route handler." },
|
|
1323
|
+
"insertText": "@Version('${1:1}')",
|
|
1324
|
+
"insertTextRules": 4,
|
|
1325
|
+
"sortText": "01_@Version"
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
"label": "DocumentBuilder",
|
|
1329
|
+
"kind": 5,
|
|
1330
|
+
"detail": "Swagger Document Builder",
|
|
1331
|
+
"documentation": { "value": "Builder class for creating Swagger/OpenAPI document configuration." },
|
|
1332
|
+
"insertText": "new DocumentBuilder()\n .setTitle('${1:API}')\n .setDescription('${2:Description}')\n .setVersion('${3:1.0}')\n .build()",
|
|
1333
|
+
"insertTextRules": 4,
|
|
1334
|
+
"sortText": "02_DocumentBuilder"
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
"label": "ThrottlerGuard",
|
|
1338
|
+
"kind": 5,
|
|
1339
|
+
"detail": "Throttler Guard",
|
|
1340
|
+
"documentation": { "value": "Guard that limits request rates. Used with ThrottlerModule." },
|
|
1341
|
+
"insertText": "ThrottlerGuard",
|
|
1342
|
+
"insertTextRules": 4,
|
|
1343
|
+
"sortText": "04_ThrottlerGuard"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
"label": "RolesGuard",
|
|
1347
|
+
"kind": 5,
|
|
1348
|
+
"detail": "Roles Guard (pattern)",
|
|
1349
|
+
"documentation": { "value": "Common pattern for role-based access control guard using Reflector." },
|
|
1350
|
+
"insertText": "@Injectable()\nexport class RolesGuard implements CanActivate {\n constructor(private reflector: Reflector) {}\n\n canActivate(context: ExecutionContext): boolean {\n const roles = this.reflector.get<string[]>('roles', context.getHandler());\n if (!roles) return true;\n const request = context.switchToHttp().getRequest();\n const user = request.user;\n return roles.some((role) => user.roles?.includes(role));\n }\n}",
|
|
1351
|
+
"insertTextRules": 4,
|
|
1352
|
+
"sortText": "04_RolesGuard"
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
"label": "MapPipe",
|
|
1356
|
+
"kind": 5,
|
|
1357
|
+
"detail": "Map Pipe",
|
|
1358
|
+
"documentation": { "value": "Pipe that applies a transformation function to the input value." },
|
|
1359
|
+
"insertText": "new MapPipe(${1:value => value})",
|
|
1360
|
+
"insertTextRules": 4,
|
|
1361
|
+
"sortText": "04_MapPipe"
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"label": "ParseFilePipe",
|
|
1365
|
+
"kind": 5,
|
|
1366
|
+
"detail": "Parse File Pipe",
|
|
1367
|
+
"documentation": { "value": "Pipe for validating file uploads with validators like MaxFileSizeValidator and FileTypeValidator." },
|
|
1368
|
+
"insertText": "new ParseFilePipe({\n validators: [\n new MaxFileSizeValidator({ maxSize: ${1:1000000} }),\n new FileTypeValidator({ fileType: '${2:image/jpeg}' }),\n ],\n})",
|
|
1369
|
+
"insertTextRules": 4,
|
|
1370
|
+
"sortText": "04_ParseFilePipe"
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
"label": "TimeoutInterceptor",
|
|
1374
|
+
"kind": 5,
|
|
1375
|
+
"detail": "Timeout Interceptor (pattern)",
|
|
1376
|
+
"documentation": { "value": "Common pattern for a timeout interceptor that throws RequestTimeoutException." },
|
|
1377
|
+
"insertText": "@Injectable()\nexport class TimeoutInterceptor implements NestInterceptor {\n intercept(context: ExecutionContext, next: CallHandler): Observable<any> {\n return next.handle().pipe(\n timeout(${1:5000}),\n catchError(err => {\n if (err instanceof TimeoutError) {\n throw new RequestTimeoutException();\n }\n throw err;\n }),\n );\n }\n}",
|
|
1378
|
+
"insertTextRules": 4,
|
|
1379
|
+
"sortText": "04_TimeoutInterceptor"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
"label": "LoggingInterceptor",
|
|
1383
|
+
"kind": 5,
|
|
1384
|
+
"detail": "Logging Interceptor (pattern)",
|
|
1385
|
+
"documentation": { "value": "Common pattern for a logging interceptor that logs method execution time." },
|
|
1386
|
+
"insertText": "@Injectable()\nexport class LoggingInterceptor implements NestInterceptor {\n private readonly logger = new Logger(LoggingInterceptor.name);\n\n intercept(context: ExecutionContext, next: CallHandler): Observable<any> {\n const now = Date.now();\n return next.handle().pipe(\n tap(() => this.logger.log(`${context.getHandler().name} - ${Date.now() - now}ms`)),\n );\n }\n}",
|
|
1387
|
+
"insertTextRules": 4,
|
|
1388
|
+
"sortText": "04_LoggingInterceptor"
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
"label": "AllExceptionsFilter",
|
|
1392
|
+
"kind": 5,
|
|
1393
|
+
"detail": "All Exceptions Filter (pattern)",
|
|
1394
|
+
"documentation": { "value": "Exception filter that catches all exceptions, not just HttpException." },
|
|
1395
|
+
"insertText": "@Catch()\nexport class AllExceptionsFilter implements ExceptionFilter {\n catch(exception: unknown, host: ArgumentsHost) {\n const ctx = host.switchToHttp();\n const response = ctx.getResponse();\n const status = exception instanceof HttpException\n ? exception.getStatus()\n : HttpStatus.INTERNAL_SERVER_ERROR;\n\n response.status(status).json({\n statusCode: status,\n timestamp: new Date().toISOString(),\n message: exception instanceof Error ? exception.message : 'Internal server error',\n });\n }\n}",
|
|
1396
|
+
"insertTextRules": 4,
|
|
1397
|
+
"sortText": "04_AllExceptionsFilter"
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
"label": "@UseInterceptors(FileInterceptor)",
|
|
1401
|
+
"kind": 1,
|
|
1402
|
+
"detail": "File upload setup",
|
|
1403
|
+
"documentation": { "value": "Applies FileInterceptor for handling single file upload endpoints." },
|
|
1404
|
+
"insertText": "@UseInterceptors(FileInterceptor('${1:file}'))\n@Post('upload')\nuploadFile(@UploadedFile() file: Express.Multer.File) {\n return { filename: file.originalname };\n}",
|
|
1405
|
+
"insertTextRules": 4,
|
|
1406
|
+
"sortText": "01_@UseInterceptors_File"
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"label": "DynamicModule",
|
|
1410
|
+
"kind": 7,
|
|
1411
|
+
"detail": "Dynamic Module interface",
|
|
1412
|
+
"documentation": { "value": "Interface returned by static methods like forRoot() and forRootAsync() for dynamic module registration." },
|
|
1413
|
+
"insertText": "DynamicModule",
|
|
1414
|
+
"insertTextRules": 4,
|
|
1415
|
+
"sortText": "02_DynamicModule"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
"label": "Provider",
|
|
1419
|
+
"kind": 7,
|
|
1420
|
+
"detail": "Provider type",
|
|
1421
|
+
"documentation": { "value": "Union type representing all valid NestJS provider types: class, value, factory, existing." },
|
|
1422
|
+
"insertText": "Provider",
|
|
1423
|
+
"insertTextRules": 4,
|
|
1424
|
+
"sortText": "02_Provider"
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
"label": "FactoryProvider",
|
|
1428
|
+
"kind": 7,
|
|
1429
|
+
"detail": "Factory Provider",
|
|
1430
|
+
"documentation": { "value": "Provider that uses a factory function to create the provider instance." },
|
|
1431
|
+
"insertText": "{\n provide: '${1:TOKEN}',\n useFactory: (${2:dep}: ${3:Dep}) => {\n return ${0:new Service(dep)};\n },\n inject: [${3:Dep}],\n}",
|
|
1432
|
+
"insertTextRules": 4,
|
|
1433
|
+
"sortText": "02_FactoryProvider"
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
"label": "ClassProvider",
|
|
1437
|
+
"kind": 7,
|
|
1438
|
+
"detail": "Class Provider",
|
|
1439
|
+
"documentation": { "value": "Provider that maps a token to a class implementation." },
|
|
1440
|
+
"insertText": "{\n provide: ${1:AbstractService},\n useClass: ${2:ConcreteService},\n}",
|
|
1441
|
+
"insertTextRules": 4,
|
|
1442
|
+
"sortText": "02_ClassProvider"
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
"label": "ValueProvider",
|
|
1446
|
+
"kind": 7,
|
|
1447
|
+
"detail": "Value Provider",
|
|
1448
|
+
"documentation": { "value": "Provider that maps a token to a static value." },
|
|
1449
|
+
"insertText": "{\n provide: '${1:CONFIG}',\n useValue: ${2:{ key: 'value' }},\n}",
|
|
1450
|
+
"insertTextRules": 4,
|
|
1451
|
+
"sortText": "02_ValueProvider"
|
|
1452
|
+
}
|
|
1453
|
+
]
|
|
1454
|
+
}
|