Skip to content

Commit e33b723

Browse files
committed
Merge remote-tracking branch 'origin/develop' into gestaohospital
2 parents ad15035 + 62c33d6 commit e33b723

66 files changed

Lines changed: 17125 additions & 4 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ hs_err_pid*
178178
/js_npm/rest/realworld-app/build/
179179
/js_npm/rest/spacex-api/node_modules/
180180
/js_npm/rest/spacex-api/build/
181+
/js_npm/graphql/react-finland/build/
182+
/js_npm/graphql/react-finland/.idea/
183+
/js_npm/graphql/react-finland/node_modules/
184+
/js_npm/graphql/react-finland/instrumented/
185+
/js_npm/graphql/ecommerce-server/build/
186+
/js_npm/graphql/ecommerce-server/.idea/
187+
/js_npm/graphql/ecommerce-server/node_modules/
188+
/js_npm/graphql/ecommerce-server/instrumented/
189+
/js_npm/graphql/ecommerce-server/src/graphql/schemas/schema.gql
181190

182191

183192
#DotNet
@@ -200,7 +209,3 @@ dotnet_3/em/embedded/rest/SampleProjectDriver/logs/
200209

201210

202211

203-
/js_npm/graphql/react-finland/build/
204-
/js_npm/graphql/react-finland/.idea/
205-
/js_npm/graphql/react-finland/node_modules/
206-
/js_npm/graphql/react-finland/instrumented/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DATABASE_HOST=
2+
DATABASE_NAME=
3+
DATABASE_USER=
4+
DATABASE_PASSWORD=
5+
DATABASE_PORT=
6+
7+
SECRET=
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const tsconfig = require(`./tsconfig`);
2+
3+
module.exports = {
4+
parser: '@typescript-eslint/parser',
5+
parserOptions: {
6+
sourceType: 'module',
7+
tsconfigRootDir: __dirname,
8+
project: ["./tsconfig.json"],
9+
},
10+
plugins: ['@typescript-eslint/eslint-plugin'],
11+
extends: [
12+
'plugin:@typescript-eslint/recommended',
13+
`plugin:@typescript-eslint/eslint-recommended`,
14+
'plugin:prettier/recommended',
15+
],
16+
root: true,
17+
env: {
18+
node: true,
19+
jest: true,
20+
},
21+
ignorePatterns: ['.eslintrc.js'],
22+
rules: {
23+
'@typescript-eslint/interface-name-prefix': 'off',
24+
'@typescript-eslint/explicit-function-return-type': 'off',
25+
'@typescript-eslint/explicit-module-boundary-types': 'off',
26+
'@typescript-eslint/no-explicit-any': 'off',
27+
},
28+
settings: {
29+
'import/resolver': {
30+
typescript: {
31+
project: `.`,
32+
},
33+
},
34+
},
35+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
pnpm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# OS
15+
.DS_Store
16+
17+
# Tests
18+
/coverage
19+
/.nyc_output
20+
21+
# IDEs and editors
22+
/.idea
23+
.project
24+
.classpath
25+
.c9/
26+
*.launch
27+
.settings/
28+
*.sublime-workspace
29+
30+
# IDE - VSCode
31+
.vscode/*
32+
!.vscode/settings.json
33+
!.vscode/tasks.json
34+
!.vscode/launch.json
35+
!.vscode/extensions.json
36+
37+
.env.development
38+
.env.production
39+
.env
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"trailingComma": "all",
3+
"singleQuote": true,
4+
"printWidth": 100,
5+
"tabWidth": 2,
6+
"prettier/prettier": ["error",{
7+
"endOfLine": "auto"
8+
}
9+
]
10+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
TODO - Add table category
2+
TODO - Add table sub category
3+
TODO - Add table tags
4+
TODO - Create pipe to validate if the seller are employee to the correct store and if have the correct role
5+
6+
<p align="center">
7+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
8+
</p>
9+
10+
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
11+
[circleci-url]: https://circleci.com/gh/nestjs/nest
12+
13+
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
14+
<p align="center">
15+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
16+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
17+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
18+
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
19+
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
20+
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
21+
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
22+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
23+
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
24+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
25+
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
26+
</p>
27+
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
28+
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
29+
30+
## Description
31+
32+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
33+
34+
## Installation
35+
36+
```bash
37+
$ npm install
38+
```
39+
40+
## Running the app
41+
42+
```bash
43+
# development
44+
$ npm run start
45+
46+
# watch mode
47+
$ npm run start:dev
48+
49+
# production mode
50+
$ npm run start:prod
51+
```
52+
53+
## Test
54+
55+
```bash
56+
# unit tests
57+
$ npm run test
58+
59+
# e2e tests
60+
$ npm run test:e2e
61+
62+
# test coverage
63+
$ npm run test:cov
64+
```
65+
66+
## Support
67+
68+
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
69+
70+
## Stay in touch
71+
72+
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
73+
- Website - [https://nestjs.com](https://nestjs.com/)
74+
- Twitter - [@nestframework](https://twitter.com/nestframework)
75+
76+
## License
77+
78+
Nest is [MIT licensed](LICENSE).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Use postgres/example user/password credentials
2+
version: '3.1'
3+
4+
services:
5+
db:
6+
container_name: pg_database
7+
image: postgres
8+
restart: always
9+
ports:
10+
- '${DATABASE_PORT}:${DATABASE_PORT}'
11+
hostname: '${DATABASE_HOST}'
12+
environment:
13+
POSTGRES_USER: '${DATABASE_USER}'
14+
POSTGRES_PASSWORD: '${DATABASE_PASSWORD}'
15+
POSTGRES_DB: '${DATABASE_NAME}'
16+
pgadmin:
17+
container_name: pgadmin4_container
18+
image: dpage/pgadmin4
19+
restart: always
20+
environment:
21+
PGADMIN_DEFAULT_EMAIL: admin@admin.com
22+
PGADMIN_DEFAULT_PASSWORD: root
23+
ports:
24+
- "5050:80"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
const em = require("evomaster-client-js");
2+
const dbHandler = require("./db-handler");
3+
4+
const {NestFactory} = require('@nestjs/core');
5+
const superagent = require("superagent");
6+
7+
class AppController extends em.SutController {
8+
9+
setupForGeneratedTest() {
10+
}
11+
12+
getInfoForAuthentication() {
13+
let jwtLogin = new em.dto.JsonTokenPostLoginDto();
14+
jwtLogin.endpoint = "/graphql";
15+
jwtLogin.userId = "foo";
16+
jwtLogin.extractTokenField = "/data/login/token";
17+
jwtLogin.jsonPayload = `{
18+
"query": "mutation{login(data:{email:\\"foo@foo.com\\",password:\\"bar123\\"}){token}}"
19+
}`;
20+
jwtLogin.headerPrefix = "Bearer ";
21+
22+
23+
let auth = new em.dto.AuthenticationDto();
24+
auth.name = "foo-auth";
25+
auth.jsonTokenPostLogin = jwtLogin;
26+
return [auth];
27+
}
28+
29+
getPreferredOutputFormat() {
30+
return em.dto.OutputFormat.JS_JEST;
31+
}
32+
33+
getProblemInfo() {
34+
const dto = new em.dto.GraphQLProblemDto();
35+
dto.endpoint = "/graphql"
36+
return dto;
37+
}
38+
39+
isSutRunning() {
40+
if (!this.server) {
41+
return false;
42+
}
43+
return this.server.listening;
44+
}
45+
46+
resetStateOfSUT() {
47+
return new Promise((resolve) => {
48+
dbHandler.cleanDb().then(async () => {
49+
await superagent
50+
.post(this.baseUrlOfSut + "/graphql")
51+
.set('Content-Type', 'application/json')
52+
.send(`{
53+
"query" : "mutation{createUser(data:{ name:\\"foo\\",username:\\"foo\\", email:\\"foo@foo.com\\",password:\\"bar123\\",confirmPassword:\\"bar123\\"}){username}}"
54+
}`)
55+
//.ok(res => res.status);
56+
resolve();
57+
});
58+
});
59+
}
60+
61+
startSut() {
62+
63+
return new Promise(async (resolve) => {
64+
65+
await dbHandler.startDb();
66+
67+
process.env.SECRET = "a secret";
68+
process.env.DATABASE_USER = "foo"
69+
process.env.DATABASE_PASSWORD = "bar"
70+
process.env.DATABASE_HOST = "localhost"
71+
process.env.DATABASE_NAME = "db";
72+
process.env.DATABASE_PORT = process.env.DB_PORT
73+
74+
const {AppModule} = require('./../src/app.module');
75+
76+
const app = await NestFactory.create(AppModule);
77+
app.setGlobalPrefix('api')
78+
79+
app.listen(0, "localhost", () => {
80+
this.server = app.getHttpServer();
81+
this.port = this.server.address().port;
82+
const url = "http://localhost:" + this.port;
83+
this.baseUrlOfSut = url;
84+
console.log("Started API at: " + url)
85+
resolve(url);
86+
});
87+
});
88+
}
89+
90+
stopSut() {
91+
return new Promise(async (resolve) => {
92+
await dbHandler.stopDb();
93+
this.server.close(() => resolve())
94+
});
95+
}
96+
97+
}
98+
99+
100+
module.exports = AppController;

0 commit comments

Comments
 (0)