Skip to content

Commit 520178a

Browse files
chore: resolve conflicts
2 parents e284c9f + 7be96ed commit 520178a

File tree

9 files changed

+1687
-7112
lines changed

9 files changed

+1687
-7112
lines changed

.circleci/config.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ version: 2
33
aliases:
44
- &restore-cache
55
restore_cache:
6-
name: Restore Yarn Package Cache
7-
keys:
8-
- yarn-packages-{{ checksum "yarn.lock" }}
6+
name: Restore Yarn Package Cache
7+
keys:
8+
- yarn-packages-{{ checksum "yarn.lock" }}
99
- &install-deps
1010
run:
11-
name: Install dependencies
12-
command: yarn
11+
name: Install dependencies
12+
command: yarn
1313
- &build-packages
1414
run:
15-
name: Build
16-
command: npm run build
15+
name: Build
16+
command: npm run build
1717

1818
jobs:
1919
build:
2020
working_directory: ~/nest
2121
docker:
22-
- image: cimg/node:17.9
22+
- image: cimg/node:18.10
2323
steps:
2424
- checkout
2525
- restore_cache:
@@ -36,12 +36,12 @@ jobs:
3636
- ~/.cache/yarn
3737
- run:
3838
name: Build
39-
command: npm run build
40-
39+
command: npm run build
40+
4141
unit_tests:
4242
working_directory: ~/nest
4343
docker:
44-
- image: cimg/node:17.9
44+
- image: cimg/node:18.10
4545
steps:
4646
- checkout
4747
- restore_cache:
@@ -58,7 +58,7 @@ jobs:
5858
- ~/.cache/yarn
5959
- run:
6060
name: Tests
61-
command: npm run test
61+
command: npm run test
6262

6363
workflows:
6464
version: 2
@@ -67,4 +67,4 @@ workflows:
6767
- build
6868
- unit_tests:
6969
requires:
70-
- build
70+
- build

.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ module.exports = {
88
extends: [
99
'plugin:@typescript-eslint/eslint-recommended',
1010
'plugin:@typescript-eslint/recommended',
11-
'prettier',
12-
'prettier/@typescript-eslint'
11+
'prettier'
1312
],
1413
root: true,
1514
env: {

lib/azure-http.adapter.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/ban-types */
12
import { Context, HttpRequest } from '@azure/functions';
23
import { HttpServer, INestApplication } from '@nestjs/common';
34
import { createHandlerAdapter } from './adapter/azure-adapter';
@@ -14,14 +15,18 @@ export class AzureHttpAdapterStatic {
1415
if (handler) {
1516
return handler(context, req);
1617
}
17-
this.createHandler(createApp).then(fn => fn(context, req));
18+
this.createHandler(createApp).then((fn) => fn(context, req));
1819
}
1920

20-
private async createHandler(createApp: () => Promise<INestApplication>) {
21+
private async createHandler(
22+
createApp: () => Promise<
23+
Omit<INestApplication, 'startAllMicroservicesAsync' | 'listenAsync'>
24+
>
25+
) {
2126
const app = await createApp();
2227
const adapter = app.getHttpAdapter();
2328
if (this.hasGetTypeMethod(adapter) && adapter.getType() === 'azure-http') {
24-
return ((adapter as any) as AzureHttpRouter).handle.bind(adapter);
29+
return (adapter as any as AzureHttpRouter).handle.bind(adapter);
2530
}
2631
const instance = app.getHttpAdapter().getInstance();
2732
handler = createHandlerAdapter(instance);

lib/router/azure-http.router.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
/* eslint-disable @typescript-eslint/ban-types */
12
/* eslint-disable @typescript-eslint/no-unused-vars */
23
/* eslint-disable @typescript-eslint/no-empty-function */
3-
import { HttpStatus, RequestMethod } from '@nestjs/common';
4+
import {
5+
HttpStatus,
6+
InternalServerErrorException,
7+
NotImplementedException,
8+
RequestMethod,
9+
VersioningOptions
10+
} from '@nestjs/common';
11+
import { VersionValue } from '@nestjs/common/interfaces';
412
import { CorsOptions } from '@nestjs/common/interfaces/external/cors-options.interface';
513
import { AbstractHttpAdapter } from '@nestjs/core';
614
import { RouterMethodFactory } from '@nestjs/core/helpers/router-method-factory';
@@ -61,6 +69,10 @@ export class AzureHttpRouter extends AbstractHttpAdapter {
6169
response.statusCode = statusCode;
6270
}
6371

72+
public end(response: any, message?: string) {
73+
return response.end(message);
74+
}
75+
6476
public getHttpServer<T = any>(): T {
6577
return this.instance as T;
6678
}
@@ -69,6 +81,10 @@ export class AzureHttpRouter extends AbstractHttpAdapter {
6981
return this.instance as T;
7082
}
7183

84+
public isHeadersSent(response: any): boolean {
85+
return response.headersSent;
86+
}
87+
7288
public setHeader(response: any, name: string, value: string) {
7389
return response.setHeader(name, value);
7490
}
@@ -97,6 +113,17 @@ export class AzureHttpRouter extends AbstractHttpAdapter {
97113
return 'azure-http';
98114
}
99115

116+
public applyVersionFilter(
117+
handler: Function,
118+
version: VersionValue,
119+
versioningOptions: VersioningOptions
120+
) {
121+
throw new NotImplementedException();
122+
return (req, res, next) => {
123+
return () => {};
124+
};
125+
}
126+
100127
public listen(port: any, ...args: any[]) {}
101128
public render(response: any, view: string, options: any) {}
102129
public redirect(response: any, statusCode: number, url: string) {}

0 commit comments

Comments
 (0)