@nest-omni/core 1.0.8 → 1.0.10
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/dist/common/dto/index.d.ts +6 -0
- package/dist/common/dto/index.js +22 -0
- package/dist/common/index.d.ts +4 -0
- package/dist/common/index.js +20 -0
- package/dist/constants/index.d.ts +0 -2
- package/dist/constants/index.js +0 -2
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.js +0 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/validators/index.d.ts +3 -0
- package/dist/validators/index.js +3 -0
- package/package.json +16 -2
- package/dist/constants/role-type.d.ts +0 -4
- package/dist/constants/role-type.js +0 -8
- package/dist/constants/token-type.d.ts +0 -4
- package/dist/constants/token-type.js +0 -8
- package/dist/setup-swagger.d.ts +0 -2
- package/dist/setup-swagger.js +0 -62
package/dist/validators/index.js
CHANGED
|
@@ -17,3 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./phone-country-code.validator"), exports);
|
|
18
18
|
__exportStar(require("./skip-empty.validator"), exports);
|
|
19
19
|
__exportStar(require("./file-mimetype.validator"), exports);
|
|
20
|
+
__exportStar(require("./is-exists.validator"), exports);
|
|
21
|
+
__exportStar(require("./is-unique.validator"), exports);
|
|
22
|
+
__exportStar(require("./same-as.validator"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nest-omni/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
|
-
"
|
|
23
|
+
"peerDependencies": {
|
|
24
24
|
"@dataui/crud": "^5.3.0",
|
|
25
25
|
"@dataui/crud-typeorm": "^5.3.0",
|
|
26
26
|
"@liaoliaots/nestjs-redis-health": "^9.0.4",
|
|
@@ -66,5 +66,19 @@
|
|
|
66
66
|
"typeorm": "^0.3.17",
|
|
67
67
|
"typeorm-transactional": "~0.4.1",
|
|
68
68
|
"uuid": "^9.0.1"
|
|
69
|
+
},
|
|
70
|
+
"exports": {
|
|
71
|
+
".": "./dist/index.js",
|
|
72
|
+
"./setup": "./dist/setup/index.js",
|
|
73
|
+
"./common": "./dist/common/index.js",
|
|
74
|
+
"./constants": "./dist/constants/index.js",
|
|
75
|
+
"./decorators": "./dist/decorators/index.js",
|
|
76
|
+
"./filters": "./dist/filters/index.js",
|
|
77
|
+
"./interfaces": "./dist/interfaces/index.js",
|
|
78
|
+
"./interceptors": "./dist/interceptors/index.js",
|
|
79
|
+
"./shared": "./dist/shared/index.js",
|
|
80
|
+
"./types": "./dist/types/index.js",
|
|
81
|
+
"./middlewares": "./dist/middlewares/index.js",
|
|
82
|
+
"./validators": "./dist/validators/index.js"
|
|
69
83
|
}
|
|
70
84
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TokenType = void 0;
|
|
4
|
-
var TokenType;
|
|
5
|
-
(function (TokenType) {
|
|
6
|
-
TokenType["ACCESS_TOKEN"] = "ACCESS_TOKEN";
|
|
7
|
-
TokenType["REFRESH_TOKEN"] = "REFRESH_TOKEN";
|
|
8
|
-
})(TokenType || (exports.TokenType = TokenType = {}));
|
package/dist/setup-swagger.d.ts
DELETED
package/dist/setup-swagger.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupSwagger = void 0;
|
|
4
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
5
|
-
function setupSwagger(app) {
|
|
6
|
-
const documentBuilder = new swagger_1.DocumentBuilder()
|
|
7
|
-
.setTitle('API')
|
|
8
|
-
.setDescription(`### REST
|
|
9
|
-
|
|
10
|
-
Routes is following REST standard (Richardson level 3)
|
|
11
|
-
|
|
12
|
-
<details><summary>Detailed specification</summary>
|
|
13
|
-
<p>
|
|
14
|
-
|
|
15
|
-
**List:**
|
|
16
|
-
- \`GET /<resource>/\`
|
|
17
|
-
- Get the list of **<resource>** as admin
|
|
18
|
-
- \`GET /user/<user_id>/<resource>/\`
|
|
19
|
-
- Get the list of **<resource>** for a given **<user_id>**
|
|
20
|
-
- Output a **403** if logged user is not **<user_id>**
|
|
21
|
-
|
|
22
|
-
**Detail:**
|
|
23
|
-
- \`GET /<resource>/<resource_id>\`
|
|
24
|
-
- Get the detail for **<resource>** of id **<resource_id>**
|
|
25
|
-
- Output a **404** if not found
|
|
26
|
-
- \`GET /user/<user_id>/<resource>/<resource_id>\`
|
|
27
|
-
- Get the list of **<resource>** for a given **user_id**
|
|
28
|
-
- Output a **404** if not found
|
|
29
|
-
- Output a **403** if:
|
|
30
|
-
- Logged user is not **<user_id>**
|
|
31
|
-
- The **<user_id>** have no access to **<resource_id>**
|
|
32
|
-
|
|
33
|
-
**Creation / Edition / Replacement / Suppression:**
|
|
34
|
-
- \`<METHOD>\` is:
|
|
35
|
-
- **POST** for creation
|
|
36
|
-
- **PATCH** for update (one or more fields)
|
|
37
|
-
- **PUT** for replacement (all fields, not used)
|
|
38
|
-
- **DELETE** for suppression (all fields, not used)
|
|
39
|
-
- \`<METHOD> /<resource>/<resource_id>\`
|
|
40
|
-
- Create **<resource>** with id **<resource_id>** as admin
|
|
41
|
-
- Output a **400** if **<resource_id>** conflicts with existing **<resource>**
|
|
42
|
-
- \`<METHOD> /user/<user_id>/<resource>/<resource_id>\`
|
|
43
|
-
- Create **<resource>** with id **<resource_id>** as a given **user_id**
|
|
44
|
-
- Output a **409** if **<resource_id>** conflicts with existing **<resource>**
|
|
45
|
-
- Output a **403** if:
|
|
46
|
-
- Logged user is not **<user_id>**
|
|
47
|
-
- The **<user_id>** have no access to **<resource_id>**
|
|
48
|
-
</p>
|
|
49
|
-
</details>`)
|
|
50
|
-
.addBearerAuth();
|
|
51
|
-
if (process.env.API_VERSION) {
|
|
52
|
-
documentBuilder.setVersion(process.env.API_VERSION);
|
|
53
|
-
}
|
|
54
|
-
const document = swagger_1.SwaggerModule.createDocument(app, documentBuilder.build());
|
|
55
|
-
swagger_1.SwaggerModule.setup('documentation', app, document, {
|
|
56
|
-
swaggerOptions: {
|
|
57
|
-
persistAuthorization: true,
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
console.info(`Documentation: http://localhost:${process.env.PORT}/documentation`);
|
|
61
|
-
}
|
|
62
|
-
exports.setupSwagger = setupSwagger;
|