@nestjs/platform-fastify 9.2.0 → 9.3.0-beta.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2022 Kamil Mysliwiec <https://kamilmysliwiec.com>
3
+ Copyright (c) 2017-2023 Kamil Mysliwiec <https://kamilmysliwiec.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/Readme.md CHANGED
@@ -78,7 +78,10 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
78
78
  <td>
79
79
  <a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="110" valign="middle" /></a></td><td>
80
80
  <a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td><td>
81
- <a href="https://fuseautotech.com/" target="_blank"><img src="https://nestjs.com/img/fuse-logo.svg" width="105" valign="middle" /></a></td></</tr></table>
81
+ <a href="https://fuseautotech.com/" target="_blank"><img src="https://nestjs.com/img/fuse-logo.svg" width="105" valign="middle" /></a></td>
82
+ <td>
83
+ <a href="https://ridicorp.com/career/" target="_blank"><img src="https://nestjs.com/img/ridi-logo.svg" width="105" valign="middle" /></a></td><td>
84
+ <a href="https://www.movavi.com/imovie-for-windows.html" target="_blank"><img src="https://nestjs.com/img/movavi-logo.svg" width="105" valign="middle" /></a></td></</tr></table>
82
85
 
83
86
  #### Silver Sponsors
84
87
 
@@ -91,7 +94,8 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
91
94
  <td><a href="https://www.tinystacks.com" target="_blank"><img src="https://nestjs.com/img/tinystacks-logo.png#1" width="140" valign="middle" /></td>
92
95
  <td><a href="https://n.inc" target="_blank"><img src="https://nestjs.com/img/n-inc-logo.svg" width="120" valign="middle" /></td></tr><tr>
93
96
  <td><a href="https://bilberrry.com/" target="_blank"><img src="https://nestjs.com/img/bilberrry-logo.svg" width="180" valign="middle" /></td>
94
- <td><a href="https://ipinfo.ai/" target="_blank"><img src="https://nestjs.com/img/ipinfo-logo.png" width="130" valign="middle" /></td></tr>
97
+ <td><a href="https://ipinfo.ai/" target="_blank"><img src="https://nestjs.com/img/ipinfo-logo.png" width="130" valign="middle" /></td>
98
+ <td><a href="https://chax.at" target="_blank"><img src="https://nestjs.com/img/chaxat-logo.png" width="100" valign="middle" /></td></tr>
95
99
  </table>
96
100
 
97
101
  #### Sponsors
@@ -132,7 +136,8 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
132
136
  <td align="center" valign="middle"><a href="https://mobilereality.pl/" target="_blank"><img src="https://nestjs.com/img/mobile-reality-logo.png" width="45" valign="middle" /></a></td>
133
137
  <td align="center" valign="middle"><a href="https://boringowl.io/" target="_blank"><img src="https://nestjs.com/img/boringowl-logo.svg" width="120" valign="middle" /></a></td>
134
138
  <td align="center" valign="middle"><a href="https://www.mobilefactory.jp/" target="_blank"><img src="https://nestjs.com/img/mobilefactory-logo.png" width="100" valign="middle" /></a></td>
135
- <td align="center" valign="middle"><a href="https://db.nordbot.app/" target="_blank"><img src="https://nestjs.com/img/nord-logo.png" width="50" valign="middle" /></a></td>
139
+ <td align="center" valign="middle"><a href="https://nordbot.app/" target="_blank"><img src="https://nestjs.com/img/nordbot-logo.png" width="120" valign="middle" /></a></td>
140
+ <td align="center" valign="middle"><a href="https://doppio.sh/" target="_blank"><img src="https://nestjs.com/img/dopiosh-logo.png" width="50" valign="middle" /></a></td>
136
141
  </tr></table>
137
142
 
138
143
  ## Backers
@@ -4,11 +4,11 @@ import { RequestMethod, VersioningOptions } from '@nestjs/common';
4
4
  import { VersionValue } from '@nestjs/common/interfaces';
5
5
  import { CorsOptions, CorsOptionsDelegate } from '@nestjs/common/interfaces/external/cors-options.interface';
6
6
  import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
7
- import { FastifyInstance, FastifyLoggerInstance, FastifyPluginAsync, FastifyPluginCallback, FastifyReply, FastifyRequest, FastifyServerOptions, RawReplyDefaultExpression, RawRequestDefaultExpression, RawServerBase, RawServerDefault, RequestGenericInterface } from 'fastify';
7
+ import { FastifyInstance, FastifyLoggerInstance, FastifyPluginAsync, FastifyPluginCallback, FastifyRegister, FastifyReply, FastifyRequest, FastifyServerOptions, RawReplyDefaultExpression, RawRequestDefaultExpression, RawServerBase, RawServerDefault, RequestGenericInterface } from 'fastify';
8
8
  import * as http2 from 'http2';
9
9
  import * as https from 'https';
10
10
  import { Chain as LightMyRequestChain, InjectOptions, Response as LightMyRequestResponse } from 'light-my-request';
11
- import { FastifyStaticOptions, PointOfViewOptions } from '../interfaces/external';
11
+ import { FastifyStaticOptions, FastifyViewOptions } from '../interfaces/external';
12
12
  declare type FastifyHttp2SecureOptions<Server extends http2.Http2SecureServer, Logger extends FastifyLoggerInstance = FastifyLoggerInstance> = FastifyServerOptions<Server, Logger> & {
13
13
  http2: true;
14
14
  https: http2.SecureServerOptions;
@@ -63,13 +63,13 @@ export declare class FastifyAdapter<TServer extends RawServerBase = RawServerDef
63
63
  setNotFoundHandler(handler: Function): FastifyInstance<TServer, TRawRequest, TRawResponse, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>;
64
64
  getHttpServer<T = TServer>(): T;
65
65
  getInstance<T = TInstance>(): T;
66
- register<TRegister extends Parameters<TInstance['register']>>(plugin: TRegister['0'], opts?: TRegister['1']): FastifyInstance<TServer, TRawRequest, TRawResponse, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<undefined>;
66
+ register<TRegister extends Parameters<FastifyRegister<TInstance>>>(plugin: TRegister['0'], opts?: TRegister['1']): FastifyInstance<TServer, TRawRequest, TRawResponse, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<undefined>;
67
67
  inject(): LightMyRequestChain;
68
68
  inject(opts: InjectOptions | string): Promise<LightMyRequestResponse>;
69
69
  close(): Promise<undefined>;
70
70
  initHttpServer(): void;
71
71
  useStaticAssets(options: FastifyStaticOptions): FastifyInstance<TServer, TRawRequest, TRawResponse, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<undefined>;
72
- setViewEngine(options: PointOfViewOptions | string): FastifyInstance<TServer, TRawRequest, TRawResponse, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<undefined>;
72
+ setViewEngine(options: FastifyViewOptions | string): FastifyInstance<TServer, TRawRequest, TRawResponse, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<undefined>;
73
73
  isHeadersSent(response: TReply): boolean;
74
74
  setHeader(response: TReply, name: string, value: string): FastifyReply<TServer, TRawRequest, TRawResponse, import("fastify").RouteGenericInterface, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown>;
75
75
  getRequestHostname(request: TRequest): string;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /**
3
3
  * "fastify-static" interfaces
4
- * @see https://github.com/fastify/fastify-static/blob/master/index.d.ts
4
+ * @see https://github.com/fastify/fastify-static/blob/master/types/index.d.ts
5
5
  */
6
6
  import { Stats } from 'fs';
7
7
  interface ExtendedInformation {
@@ -43,6 +43,7 @@ interface SendOptions {
43
43
  index?: string[] | false;
44
44
  lastModified?: boolean;
45
45
  maxAge?: string | number;
46
+ serveDotFiles?: boolean;
46
47
  }
47
48
  export interface FastifyStaticOptions extends SendOptions {
48
49
  root: string | string[];
@@ -0,0 +1,29 @@
1
+ /**
2
+ * "fastify/view" interfaces
3
+ * @see https://github.com/fastify/point-of-view/blob/master/types/index.d.ts
4
+ */
5
+ export interface FastifyViewOptions {
6
+ engine: {
7
+ ejs?: any;
8
+ eta?: any;
9
+ nunjucks?: any;
10
+ pug?: any;
11
+ handlebars?: any;
12
+ mustache?: any;
13
+ 'art-template'?: any;
14
+ twig?: any;
15
+ liquid?: any;
16
+ dot?: any;
17
+ };
18
+ templates?: string;
19
+ includeViewExtension?: boolean;
20
+ options?: object;
21
+ charset?: string;
22
+ maxCache?: number;
23
+ production?: boolean;
24
+ defaultContext?: object;
25
+ layout?: string;
26
+ root?: string;
27
+ viewExt?: string;
28
+ propertyName?: string;
29
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,2 @@
1
1
  export * from './fastify-static-options.interface';
2
- export * from './point-of-view-options.interface';
2
+ export * from './fastify-view-options.interface';
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./fastify-static-options.interface"), exports);
5
- tslib_1.__exportStar(require("./point-of-view-options.interface"), exports);
5
+ tslib_1.__exportStar(require("./fastify-view-options.interface"), exports);
@@ -1,7 +1,7 @@
1
1
  import { INestApplication } from '@nestjs/common';
2
2
  import { FastifyInstance, FastifyPluginAsync, FastifyPluginCallback, FastifyPluginOptions, FastifyRegisterOptions } from 'fastify';
3
3
  import { Chain as LightMyRequestChain, InjectOptions, Response as LightMyRequestResponse } from 'light-my-request';
4
- import { FastifyStaticOptions, PointOfViewOptions } from './external';
4
+ import { FastifyStaticOptions, FastifyViewOptions } from './external';
5
5
  export interface NestFastifyApplication extends INestApplication {
6
6
  /**
7
7
  * A wrapper function around native `fastify.register()` method.
@@ -25,7 +25,7 @@ export interface NestFastifyApplication extends INestApplication {
25
25
  * Don't pass in a string. The string type in the argument is for compatibilility reason and will cause an exception.
26
26
  * @returns {this}
27
27
  */
28
- setViewEngine(options: PointOfViewOptions | string): this;
28
+ setViewEngine(options: FastifyViewOptions | string): this;
29
29
  /**
30
30
  * A wrapper function around native `fastify.inject()` method.
31
31
  * @returns {void}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/platform-fastify",
3
- "version": "9.2.0",
3
+ "version": "9.3.0-beta.1",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -17,11 +17,11 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@fastify/cors": "8.1.1",
21
- "@fastify/formbody": "7.3.0",
22
- "@fastify/middie": "8.0.0",
23
- "fastify": "4.9.2",
24
- "light-my-request": "5.6.1",
20
+ "@fastify/cors": "8.2.0",
21
+ "@fastify/formbody": "7.4.0",
22
+ "@fastify/middie": "8.1.0",
23
+ "fastify": "4.11.0",
24
+ "light-my-request": "5.8.0",
25
25
  "path-to-regexp": "3.2.0",
26
26
  "tslib": "2.4.1"
27
27
  },
@@ -0,0 +1,22 @@
1
+ {
2
+ "extends": "../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": ".",
5
+ "rootDir": ".",
6
+ "paths": {
7
+ "@nestjs/common": ["../common"],
8
+ "@nestjs/common/*": ["../common/*"],
9
+ "@nestjs/core": ["../core"],
10
+ "@nestjs/core/*": ["../core/*"]
11
+ }
12
+ },
13
+ "exclude": ["node_modules", "dist", "test/**/*", "*.spec.ts"],
14
+ "references": [
15
+ {
16
+ "path": "../common/tsconfig.build.json"
17
+ },
18
+ {
19
+ "path": "../core/tsconfig.build.json"
20
+ }
21
+ ]
22
+ }