Skip to content

Commit 8eb5020

Browse files
authored
Merge pull request #98 from klerick/nestjs-json-api-97
Try to adopt for MicroOrm
2 parents 739a632 + c2e9d1d commit 8eb5020

File tree

498 files changed

+19837
-9799
lines changed

Some content is hidden

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

498 files changed

+19837
-9799
lines changed

.e2e-micro.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DB_LOGGING=0
2+
ORM_TYPE=microorm

.e2e.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
DB_LOGGING=0
2+
ORM_TYPE=typeorm

.env

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ DB_LOGGING=1
33

44
DB_USERNAME="postgres"
55
DB_PASSWORD="postgres"
6-
DB_NAME="json-api-db"
6+
#DB_NAME="json-api-db"
7+
DB_NAME="postgres"
78
DB_PORT=5432
89
DB_TYPE=postgres
910

@@ -12,3 +13,7 @@ DB_TYPE=postgres
1213
#DB_NAME="example_new"
1314
#DB_PORT=3306
1415
#DB_TYPE=mysql
16+
17+
18+
ORM_TYPE=microorm
19+
#ORM_TYPE=typeorm

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
- name: Test
3131
env:
3232
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
33-
run: npx nx affected -t test --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source,type-for-rpc'
33+
run: npx nx affected -t test --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,microorm-database,typeorm-database,@nestjs-json-api/source,type-for-rpc'
3434
- name: Build
3535
env:
3636
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
37-
run: npx nx affected -t build --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source,type-for-rpc'
37+
run: npx nx affected -t build --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,microorm-database,typeorm-database,@nestjs-json-api/source,type-for-rpc'
3838
- name: Save cached .nx
3939
id: cache-dependencies-save
4040
uses: actions/cache/save@v4
@@ -85,6 +85,7 @@ jobs:
8585
- run: npm run typeorm migration:run
8686
- run: npm run seed:run
8787
- run: npx nx affected -t e2e --parallel=1
88+
- run: npx nx affected -t e2e-micro --parallel=1
8889
- name: Save cached .nx
8990
id: cache-dependencies-save
9091
uses: actions/cache/save@v4

.test.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NODE_OPTIONS=--experimental-vm-modules --disable-warning=ExperimentalWarning
2+
DB_LOGGING=0

.verdaccio/config.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# path to a directory with all packages
2+
storage: ../tmp/local-registry/storage
3+
4+
# a list of other known repositories we can talk to
5+
uplinks:
6+
npmjs:
7+
url: https://registry.npmjs.org/
8+
maxage: 60m
9+
10+
packages:
11+
'**':
12+
# give all users (including non-authenticated users) full access
13+
# because it is a local registry
14+
access: $all
15+
publish: $all
16+
unpublish: $all
17+
18+
# if package is not available locally, proxy requests to npm registry
19+
proxy: npmjs
20+
21+
# log settings
22+
log:
23+
type: stdout
24+
format: pretty
25+
level: warn
26+
27+
publish:
28+
allow_offline: true # set offline to true to allow publish offline

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
<p align="center">
2-
Json API plugins for
3-
<a href="http://nestjs.com/" target="blank">NestJS</a>
4-
framework
2+
<a href="http://nestjs.com/" target="blank">NestJS</a> JSON API & JSON RPC Suite
53
</p>
4+
65
<p>
7-
Tools to implement JSON API, such as, end point, query params, body params, validation and transformation response.
6+
This monorepo contains a set of several libraries designed to simplify the development of server and client applications using NestJS. These tools help you work with two popular protocols:
87
</p>
98

10-
- *[json-api-nestjs](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-api/json-api-nestjs)* - plugin for create CRUD overs JSON API
11-
- *[json-api-nestjs-sdk](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-api/json-api-nestjs-sdk)* - tool for client, call api over *json-api-nestjs*
12-
- *[nestjs-json-rpc](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-rpc/nestjs-json-rpc)* - plugin for create RPC server using [JSON-RPC](https://www.jsonrpc.org/)
13-
- *[nestjs-json-rpc-sdk](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-rpc/nestjs-json-rpc-sdk)* - tool for client, call RPC server *nestjs-json-rpc*
14-
- *json-api-nestjs-acl* - tool for acl over *json-api-nestjs*(coming soon...)
9+
10+
- **[JSON:API](https://jsonapi.org/)** – A specification for building RESTful APIs with standardized request and response formats.
11+
12+
> **[json-api-nestjs](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-api/json-api-nestjs)** - This package enables you to quickly set up a server API that adheres to the JSON:API specification, handling standard CRUD operations for your resources.</br>
13+
> **[json-api-nestjs-sdk](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-api/json-api-nestjs-sdk)** - tool for client, call api over *json-api-nestjs*
14+
15+
16+
- **[JSON-RPC](https://www.jsonrpc.org/)** – A protocol for remote procedure calls using JSON.
17+
18+
> **[nestjs-json-rpc](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-rpc/nestjs-json-rpc)** - Use this package to implement remote procedure call (RPC) functionality in your NestJS applications, enabling efficient inter-service communication.</br>
19+
> **[nestjs-json-rpc-sdk](https://github.com/klerick/nestjs-json-api/tree/master/libs/json-rpc/nestjs-json-rpc-sdk)** - This tool offers a straightforward way to call remote procedures from your client-side code, ensuring smooth communication with your JSON-RPC server.
20+
21+
- **ACL tools** - tool for acl over *json-api-nestjs*(coming soon...)
1522
## Installation
1623

1724
```bash
@@ -24,7 +31,7 @@ $ npm run seed:run
2431

2532
```bash
2633
# dev server
27-
$ npm run demo:json-api
34+
$ nx run json-api-server:serve:development
2835

2936
```
3037
## License

apps/json-api-server-e2e/project.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616
"passWithNoTests": true,
1717
"parallel": 1
1818
}
19+
},
20+
"e2e-micro": {
21+
"executor": "@nx/jest:jest",
22+
"outputs": [
23+
"{workspaceRoot}/coverage/{e2eProjectRoot}"
24+
],
25+
"options": {
26+
"jestConfig": "apps/json-api-server-e2e/jest.config.ts",
27+
"passWithNoTests": true,
28+
"parallel": 1
29+
}
1930
}
2031
}
2132
}

apps/json-api-server-e2e/src/json-api/json-api-sdk/atomic-sdk.spec.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { INestApplication } from '@nestjs/common';
2-
import { FilterOperand, JsonSdkPromise } from 'json-api-nestjs-sdk';
3-
import { Addresses, CommentKind, Comments, Roles, Users } from 'database';
2+
import { FilterOperand, JsonSdkPromise } from '@klerick/json-api-nestjs-sdk';
3+
import {
4+
Addresses,
5+
CommentKind,
6+
Comments,
7+
Roles,
8+
Users,
9+
} from '@nestjs-json-api/typeorm-database';
410
import { faker } from '@faker-js/faker';
511
import { getUser } from '../utils/data-utils';
612
import { run, creatSdk } from '../utils/run-application';

apps/json-api-server-e2e/src/json-api/json-api-sdk/check-common-decorator.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { INestApplication } from '@nestjs/common';
2-
import { FilterOperand, JsonSdkPromise } from 'json-api-nestjs-sdk';
2+
import { FilterOperand, JsonSdkPromise } from '@klerick/json-api-nestjs-sdk';
33
import { AxiosError } from 'axios';
4-
import { Users } from 'database';
4+
import { Users } from '@nestjs-json-api/typeorm-database';
55

66
import { run, creatSdk } from '../utils/run-application';
77

0 commit comments

Comments
 (0)