@bearei/server-common 0.0.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 +21 -0
- package/README.md +73 -0
- package/dist/action-log/action-log.interface.d.ts +12 -0
- package/dist/action-log/action-log.interface.js +3 -0
- package/dist/action-log/action-log.interface.js.map +1 -0
- package/dist/action-log/action-log.module.d.ts +2 -0
- package/dist/action-log/action-log.module.js +23 -0
- package/dist/action-log/action-log.module.js.map +1 -0
- package/dist/action-log/action-log.service.d.ts +9 -0
- package/dist/action-log/action-log.service.js +35 -0
- package/dist/action-log/action-log.service.js.map +1 -0
- package/dist/action-log/index.d.ts +3 -0
- package/dist/action-log/index.js +20 -0
- package/dist/action-log/index.js.map +1 -0
- package/dist/app.decorator.d.ts +6 -0
- package/dist/app.decorator.js +11 -0
- package/dist/app.decorator.js.map +1 -0
- package/dist/app.dto.d.ts +24 -0
- package/dist/app.dto.js +113 -0
- package/dist/app.dto.js.map +1 -0
- package/dist/app.entity.d.ts +11 -0
- package/dist/app.entity.js +87 -0
- package/dist/app.entity.js.map +1 -0
- package/dist/app.interface.d.ts +33 -0
- package/dist/app.interface.js +39 -0
- package/dist/app.interface.js.map +1 -0
- package/dist/authentication/access/access.guard.d.ts +9 -0
- package/dist/authentication/access/access.guard.js +62 -0
- package/dist/authentication/access/access.guard.js.map +1 -0
- package/dist/authentication/access/access.interface.d.ts +4 -0
- package/dist/authentication/access/access.interface.js +9 -0
- package/dist/authentication/access/access.interface.js.map +1 -0
- package/dist/authentication/access/index.d.ts +2 -0
- package/dist/authentication/access/index.js +19 -0
- package/dist/authentication/access/index.js.map +1 -0
- package/dist/authentication/auth/auth.interface.d.ts +3 -0
- package/dist/authentication/auth/auth.interface.js +3 -0
- package/dist/authentication/auth/auth.interface.js.map +1 -0
- package/dist/authentication/auth/auth.module.d.ts +2 -0
- package/dist/authentication/auth/auth.module.js +23 -0
- package/dist/authentication/auth/auth.module.js.map +1 -0
- package/dist/authentication/auth/auth.service.d.ts +8 -0
- package/dist/authentication/auth/auth.service.js +31 -0
- package/dist/authentication/auth/auth.service.js.map +1 -0
- package/dist/authentication/auth/index.d.ts +3 -0
- package/dist/authentication/auth/index.js +20 -0
- package/dist/authentication/auth/index.js.map +1 -0
- package/dist/authentication/index.d.ts +3 -0
- package/dist/authentication/index.js +20 -0
- package/dist/authentication/index.js.map +1 -0
- package/dist/authentication/permission/index.d.ts +2 -0
- package/dist/authentication/permission/index.js +19 -0
- package/dist/authentication/permission/index.js.map +1 -0
- package/dist/authentication/permission/permission.guard.d.ts +9 -0
- package/dist/authentication/permission/permission.guard.js +46 -0
- package/dist/authentication/permission/permission.guard.js.map +1 -0
- package/dist/authentication/permission/permission.interface.d.ts +35 -0
- package/dist/authentication/permission/permission.interface.js +40 -0
- package/dist/authentication/permission/permission.interface.js.map +1 -0
- package/dist/base/base.interface.d.ts +42 -0
- package/dist/base/base.interface.js +3 -0
- package/dist/base/base.interface.js.map +1 -0
- package/dist/base/base.module.d.ts +2 -0
- package/dist/base/base.module.js +23 -0
- package/dist/base/base.module.js.map +1 -0
- package/dist/base/base.service.d.ts +29 -0
- package/dist/base/base.service.js +212 -0
- package/dist/base/base.service.js.map +1 -0
- package/dist/base/index.d.ts +2 -0
- package/dist/base/index.js +19 -0
- package/dist/base/index.js.map +1 -0
- package/dist/external/external.interface.d.ts +41 -0
- package/dist/external/external.interface.js +3 -0
- package/dist/external/external.interface.js.map +1 -0
- package/dist/external/external.module.d.ts +2 -0
- package/dist/external/external.module.js +24 -0
- package/dist/external/external.module.js.map +1 -0
- package/dist/external/external.service.d.ts +12 -0
- package/dist/external/external.service.js +77 -0
- package/dist/external/external.service.js.map +1 -0
- package/dist/external/index.d.ts +3 -0
- package/dist/external/index.js +20 -0
- package/dist/external/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/redis/index.d.ts +3 -0
- package/dist/redis/index.js +20 -0
- package/dist/redis/index.js.map +1 -0
- package/dist/redis/redis.interface.d.ts +4 -0
- package/dist/redis/redis.interface.js +3 -0
- package/dist/redis/redis.interface.js.map +1 -0
- package/dist/redis/redis.module.d.ts +2 -0
- package/dist/redis/redis.module.js +23 -0
- package/dist/redis/redis.module.js.map +1 -0
- package/dist/redis/redis.service.d.ts +10 -0
- package/dist/redis/redis.service.js +44 -0
- package/dist/redis/redis.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/util/error.util.d.ts +3 -0
- package/dist/util/error.util.js +45 -0
- package/dist/util/error.util.js.map +1 -0
- package/dist/util/format.util.d.ts +3 -0
- package/dist/util/format.util.js +11 -0
- package/dist/util/format.util.js.map +1 -0
- package/dist/util/index.d.ts +3 -0
- package/dist/util/index.js +20 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/util.interface.d.ts +16 -0
- package/dist/util/util.interface.js +3 -0
- package/dist/util/util.interface.js.map +1 -0
- package/package.json +106 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Bearei
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
|
6
|
+
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
|
7
|
+
|
|
8
|
+
<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>
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
|
11
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
|
12
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
|
|
13
|
+
<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>
|
|
14
|
+
<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>
|
|
15
|
+
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
|
16
|
+
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
|
17
|
+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
|
18
|
+
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
|
|
19
|
+
<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>
|
|
20
|
+
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
|
|
21
|
+
</p>
|
|
22
|
+
<!--[](https://opencollective.com/nest#backer)
|
|
23
|
+
[](https://opencollective.com/nest#sponsor)-->
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
|
|
27
|
+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
$ yarn install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Running the app
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# development
|
|
39
|
+
$ yarn run start
|
|
40
|
+
|
|
41
|
+
# watch mode
|
|
42
|
+
$ yarn run start:dev
|
|
43
|
+
|
|
44
|
+
# production mode
|
|
45
|
+
$ yarn run start:prod
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Test
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# unit tests
|
|
52
|
+
$ yarn run test
|
|
53
|
+
|
|
54
|
+
# e2e tests
|
|
55
|
+
$ yarn run test:e2e
|
|
56
|
+
|
|
57
|
+
# test coverage
|
|
58
|
+
$ yarn run test:cov
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Support
|
|
62
|
+
|
|
63
|
+
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).
|
|
64
|
+
|
|
65
|
+
## Stay in touch
|
|
66
|
+
|
|
67
|
+
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
|
|
68
|
+
- Website - [https://nestjs.com](https://nestjs.com/)
|
|
69
|
+
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Nest is [MIT licensed](LICENSE).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action, ActionResult, APIHeaders } from '../app.interface';
|
|
2
|
+
export interface ActionLogOptions {
|
|
3
|
+
action: Action;
|
|
4
|
+
enableLogging?: boolean;
|
|
5
|
+
headers: APIHeaders;
|
|
6
|
+
message?: string;
|
|
7
|
+
raw?: Record<string, unknown>;
|
|
8
|
+
serviceName: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateActionLogOptions extends ActionLogOptions {
|
|
11
|
+
result: ActionResult;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-log.interface.js","sourceRoot":"","sources":["../../src/action-log/action-log.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ActionLogModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const external_1 = require("../external");
|
|
12
|
+
const action_log_service_1 = require("./action-log.service");
|
|
13
|
+
let ActionLogModule = class ActionLogModule {
|
|
14
|
+
};
|
|
15
|
+
exports.ActionLogModule = ActionLogModule;
|
|
16
|
+
exports.ActionLogModule = ActionLogModule = __decorate([
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
exports: [action_log_service_1.ActionLogService],
|
|
19
|
+
imports: [external_1.ExternalModule],
|
|
20
|
+
providers: [action_log_service_1.ActionLogService]
|
|
21
|
+
})
|
|
22
|
+
], ActionLogModule);
|
|
23
|
+
//# sourceMappingURL=action-log.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-log.module.js","sourceRoot":"","sources":["../../src/action-log/action-log.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAqC;AACrC,0CAA0C;AAC1C,6DAAqD;AAO9C,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAL3B,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE,CAAC,qCAAgB,CAAC;QAC3B,OAAO,EAAE,CAAC,yBAAc,CAAC;QACzB,SAAS,EAAE,CAAC,qCAAgB,CAAC;KAChC,CAAC;GACW,eAAe,CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExternalService } from '../external';
|
|
2
|
+
import { ActionLogOptions, CreateActionLogOptions } from './action-log.interface';
|
|
3
|
+
export declare class ActionLogService {
|
|
4
|
+
private readonly externalService;
|
|
5
|
+
constructor(externalService: ExternalService);
|
|
6
|
+
success(options: ActionLogOptions): (data: Record<string, unknown>) => Promise<void>;
|
|
7
|
+
failure(options: ActionLogOptions): (data: Record<string, unknown>) => Promise<void>;
|
|
8
|
+
create({ headers, enableLogging, ...args }: CreateActionLogOptions): (data: Record<string, unknown>) => Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ActionLogService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const app_interface_1 = require("../app.interface");
|
|
15
|
+
const external_1 = require("../external");
|
|
16
|
+
let ActionLogService = class ActionLogService {
|
|
17
|
+
constructor(externalService) {
|
|
18
|
+
this.externalService = externalService;
|
|
19
|
+
}
|
|
20
|
+
success(options) {
|
|
21
|
+
return async (data) => this.create({ ...options, result: app_interface_1.ActionResult.SUCCESS })(data);
|
|
22
|
+
}
|
|
23
|
+
failure(options) {
|
|
24
|
+
return async (data) => this.create({ ...options, result: app_interface_1.ActionResult.FAILURE })(data);
|
|
25
|
+
}
|
|
26
|
+
create({ headers, enableLogging = true, ...args }) {
|
|
27
|
+
return async (data) => enableLogging && (await this.externalService.createActionLog({ data: { ...args, data }, headers }));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.ActionLogService = ActionLogService;
|
|
31
|
+
exports.ActionLogService = ActionLogService = __decorate([
|
|
32
|
+
(0, common_1.Injectable)(),
|
|
33
|
+
__metadata("design:paramtypes", [external_1.ExternalService])
|
|
34
|
+
], ActionLogService);
|
|
35
|
+
//# sourceMappingURL=action-log.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-log.service.js","sourceRoot":"","sources":["../../src/action-log/action-log.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyC;AACzC,oDAA6C;AAC7C,0CAA2C;AAIpC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACzB,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAEjE,OAAO,CAAC,OAAyB;QAC7B,OAAO,KAAK,EAAE,IAA6B,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAE,4BAAY,CAAC,OAAO,EAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACjH,CAAC;IAED,OAAO,CAAC,OAAyB;QAC7B,OAAO,KAAK,EAAE,IAA6B,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAE,4BAAY,CAAC,OAAO,EAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACjH,CAAC;IAED,MAAM,CAAC,EAAC,OAAO,EAAE,aAAa,GAAG,IAAI,EAAE,GAAG,IAAI,EAAyB;QACnE,OAAO,KAAK,EAAE,IAA6B,EAAE,EAAE,CAC3C,aAAa,IAAI,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,EAAC,IAAI,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAC,CAAC,CAAC,CAAA;IACvG,CAAC;CACJ,CAAA;AAfY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAEqC,0BAAe;GADpD,gBAAgB,CAe5B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./action-log.interface"), exports);
|
|
18
|
+
__exportStar(require("./action-log.module"), exports);
|
|
19
|
+
__exportStar(require("./action-log.service"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/action-log/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAsC;AACtC,sDAAmC;AACnC,uDAAoC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import common from '@nestjs/common';
|
|
2
|
+
import { Access, Permission } from './authentication';
|
|
3
|
+
export declare const AUTH_PERMISSIONS_KEY = "authPermission";
|
|
4
|
+
export declare const IS_PUBLIC_KEY = "isPublic";
|
|
5
|
+
export declare const AuthPermission: (permissions: Permission[]) => common.CustomDecorator<string>;
|
|
6
|
+
export declare const Public: (accesses: Access[]) => common.CustomDecorator<string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Public = exports.AuthPermission = exports.IS_PUBLIC_KEY = exports.AUTH_PERMISSIONS_KEY = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
exports.AUTH_PERMISSIONS_KEY = 'authPermission';
|
|
6
|
+
exports.IS_PUBLIC_KEY = 'isPublic';
|
|
7
|
+
const AuthPermission = (permissions) => common_1.default.SetMetadata(exports.AUTH_PERMISSIONS_KEY, permissions);
|
|
8
|
+
exports.AuthPermission = AuthPermission;
|
|
9
|
+
const Public = (accesses) => common_1.default.SetMetadata(exports.IS_PUBLIC_KEY, accesses);
|
|
10
|
+
exports.Public = Public;
|
|
11
|
+
//# sourceMappingURL=app.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.decorator.js","sourceRoot":"","sources":["../src/app.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAmC;AAGtB,QAAA,oBAAoB,GAAG,gBAAgB,CAAA;AACvC,QAAA,aAAa,GAAG,UAAU,CAAA;AAEhC,MAAM,cAAc,GAAG,CAAC,WAAyB,EAAE,EAAE,CAAC,gBAAM,CAAC,WAAW,CAAC,4BAAoB,EAAE,WAAW,CAAC,CAAA;AAArG,QAAA,cAAc,kBAAuF;AAE3G,MAAM,MAAM,GAAG,CAAC,QAAkB,EAAE,EAAE,CAAC,gBAAM,CAAC,WAAW,CAAC,qBAAa,EAAE,QAAQ,CAAC,CAAA;AAA5E,QAAA,MAAM,UAAsE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ValidationOptions } from 'class-validator';
|
|
2
|
+
import { Language, Order } from './app.interface';
|
|
3
|
+
export declare const IsNanoid: (validationOptions?: ValidationOptions) => (object: Record<string, any>, propertyName: string) => void;
|
|
4
|
+
export declare class IndexDTO {
|
|
5
|
+
projectId?: string;
|
|
6
|
+
scopeId?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
page?: number;
|
|
9
|
+
size?: number;
|
|
10
|
+
count?: boolean;
|
|
11
|
+
order?: keyof typeof Order;
|
|
12
|
+
language?: keyof typeof Language;
|
|
13
|
+
ids?: string[];
|
|
14
|
+
createdAtRange?: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare class ByIdDTO {
|
|
17
|
+
id?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class ByIdsDTO {
|
|
20
|
+
ids?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class NotIdDTO {
|
|
23
|
+
notId?: string;
|
|
24
|
+
}
|
package/dist/app.dto.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NotIdDTO = exports.ByIdsDTO = exports.ByIdDTO = exports.IndexDTO = exports.IsNanoid = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const IsNanoid = (validationOptions) => (object, propertyName) => {
|
|
16
|
+
(0, class_validator_1.registerDecorator)({
|
|
17
|
+
name: 'isNanoid',
|
|
18
|
+
propertyName: propertyName,
|
|
19
|
+
target: object.constructor,
|
|
20
|
+
options: {
|
|
21
|
+
...validationOptions,
|
|
22
|
+
message: `${propertyName} must be a valid nanoid`
|
|
23
|
+
},
|
|
24
|
+
validator: {
|
|
25
|
+
validate(value) {
|
|
26
|
+
const nanoidRegex = /^[0-9a-z]{32}$/i;
|
|
27
|
+
return typeof value === 'string' && nanoidRegex.test(value);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.IsNanoid = IsNanoid;
|
|
33
|
+
class IndexDTO {
|
|
34
|
+
}
|
|
35
|
+
exports.IndexDTO = IndexDTO;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, exports.IsNanoid)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], IndexDTO.prototype, "projectId", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, exports.IsNanoid)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], IndexDTO.prototype, "scopeId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, exports.IsNanoid)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], IndexDTO.prototype, "id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsNumber)({ allowNaN: false }),
|
|
50
|
+
(0, class_validator_1.Max)(1024),
|
|
51
|
+
(0, class_validator_1.Min)(1),
|
|
52
|
+
(0, class_transformer_1.Transform)(({ value }) => parseInt(value)),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], IndexDTO.prototype, "page", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsNumber)({ allowNaN: false }),
|
|
57
|
+
(0, class_validator_1.Max)(1024),
|
|
58
|
+
(0, class_validator_1.Min)(1),
|
|
59
|
+
(0, class_transformer_1.Transform)(({ value }) => parseInt(value)),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], IndexDTO.prototype, "size", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_transformer_1.Transform)(({ value }) => value === 'true'),
|
|
64
|
+
(0, class_validator_1.IsBoolean)(),
|
|
65
|
+
__metadata("design:type", Boolean)
|
|
66
|
+
], IndexDTO.prototype, "count", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_validator_1.IsEnum)(['ASC', 'DESC']),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], IndexDTO.prototype, "order", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsEnum)(['ZH_CN', 'EN_US']),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], IndexDTO.prototype, "language", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, class_validator_1.ArrayMaxSize)(1024),
|
|
77
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
78
|
+
(0, exports.IsNanoid)({ each: true }),
|
|
79
|
+
(0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.split(',') : value)),
|
|
80
|
+
__metadata("design:type", Array)
|
|
81
|
+
], IndexDTO.prototype, "ids", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, class_validator_1.ArrayMaxSize)(2),
|
|
84
|
+
(0, class_validator_1.ArrayMinSize)(2),
|
|
85
|
+
(0, exports.IsNanoid)({ each: true }),
|
|
86
|
+
(0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.split(',') : value)),
|
|
87
|
+
__metadata("design:type", Array)
|
|
88
|
+
], IndexDTO.prototype, "createdAtRange", void 0);
|
|
89
|
+
class ByIdDTO {
|
|
90
|
+
}
|
|
91
|
+
exports.ByIdDTO = ByIdDTO;
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, exports.IsNanoid)(),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], ByIdDTO.prototype, "id", void 0);
|
|
96
|
+
class ByIdsDTO {
|
|
97
|
+
}
|
|
98
|
+
exports.ByIdsDTO = ByIdsDTO;
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, class_validator_1.ArrayMaxSize)(1024),
|
|
101
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
102
|
+
(0, exports.IsNanoid)({ each: true }),
|
|
103
|
+
(0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.split(',') : value)),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], ByIdsDTO.prototype, "ids", void 0);
|
|
106
|
+
class NotIdDTO {
|
|
107
|
+
}
|
|
108
|
+
exports.NotIdDTO = NotIdDTO;
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, exports.IsNanoid)(),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], NotIdDTO.prototype, "notId", void 0);
|
|
113
|
+
//# sourceMappingURL=app.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.dto.js","sourceRoot":"","sources":["../src/app.dto.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AppEntity = void 0;
|
|
13
|
+
const nanoid_1 = require("nanoid");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
let AppEntity = class AppEntity extends typeorm_1.BaseEntity {
|
|
16
|
+
beforeInsert() {
|
|
17
|
+
this.id = (0, nanoid_1.nanoid)();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.AppEntity = AppEntity;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryColumn)({
|
|
23
|
+
length: 32,
|
|
24
|
+
nullable: false,
|
|
25
|
+
type: 'varchar'
|
|
26
|
+
}),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AppEntity.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({
|
|
31
|
+
length: 32,
|
|
32
|
+
name: 'project_id',
|
|
33
|
+
nullable: false,
|
|
34
|
+
type: 'varchar'
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], AppEntity.prototype, "projectId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({
|
|
40
|
+
default: '',
|
|
41
|
+
length: 32,
|
|
42
|
+
name: 'scope_id',
|
|
43
|
+
nullable: false,
|
|
44
|
+
type: 'varchar'
|
|
45
|
+
}),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], AppEntity.prototype, "scopeId", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
name: 'created_at',
|
|
51
|
+
nullable: false,
|
|
52
|
+
type: 'date'
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", Date)
|
|
55
|
+
], AppEntity.prototype, "createdAt", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({
|
|
58
|
+
name: 'updated_at',
|
|
59
|
+
nullable: false,
|
|
60
|
+
type: 'date'
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", Date)
|
|
63
|
+
], AppEntity.prototype, "updatedAt", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({
|
|
66
|
+
name: 'deleted_at',
|
|
67
|
+
type: 'date'
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Date)
|
|
70
|
+
], AppEntity.prototype, "deletedAt", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.VersionColumn)({
|
|
73
|
+
nullable: false,
|
|
74
|
+
type: 'bigint'
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], AppEntity.prototype, "version", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
80
|
+
__metadata("design:type", Function),
|
|
81
|
+
__metadata("design:paramtypes", []),
|
|
82
|
+
__metadata("design:returntype", void 0)
|
|
83
|
+
], AppEntity.prototype, "beforeInsert", null);
|
|
84
|
+
exports.AppEntity = AppEntity = __decorate([
|
|
85
|
+
(0, typeorm_1.Index)(['createdAt'])
|
|
86
|
+
], AppEntity);
|
|
87
|
+
//# sourceMappingURL=app.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.entity.js","sourceRoot":"","sources":["../src/app.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAA6B;AAC7B,qCAA6F;AAGtF,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,oBAAU;IAoDrC,YAAY;QACR,IAAI,CAAC,EAAE,GAAG,IAAA,eAAM,GAAE,CAAA;IACtB,CAAC;CACJ,CAAA;AAvDY,8BAAS;AAMlB;IALC,IAAA,uBAAa,EAAC;QACX,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,SAAS;KAClB,CAAC;;qCACQ;AAQV;IANC,IAAA,gBAAM,EAAC;QACJ,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,SAAS;KAClB,CAAC;;4CACe;AASjB;IAPC,IAAA,gBAAM,EAAC;QACJ,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,SAAS;KAClB,CAAC;;0CACa;AAOf;IALC,IAAA,gBAAM,EAAC;QACJ,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,MAAM;KACf,CAAC;8BACS,IAAI;4CAAA;AAOf;IALC,IAAA,gBAAM,EAAC;QACJ,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,MAAM;KACf,CAAC;8BACS,IAAI;4CAAA;AAMf;IAJC,IAAA,gBAAM,EAAC;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,MAAM;KACf,CAAC;8BACS,IAAI;4CAAA;AAMf;IAJC,IAAA,uBAAa,EAAC;QACX,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,QAAQ;KACjB,CAAC;;0CACa;AAGf;IADC,IAAA,sBAAY,GAAE;;;;6CAGd;oBAtDQ,SAAS;IADrB,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;GACR,SAAS,CAuDrB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
export declare enum Language {
|
|
3
|
+
EN_US = "enUS",
|
|
4
|
+
ZH_CN = "zhCN"
|
|
5
|
+
}
|
|
6
|
+
export declare enum Order {
|
|
7
|
+
ASC = "asc",
|
|
8
|
+
DESC = "desc"
|
|
9
|
+
}
|
|
10
|
+
export type CustomHeaders = Record<'x-project-id' | 'x-scope-id' | 'x-authorization' | 'x-ip' | 'x-client' | 'x-request-id' | 'x-internal', string>;
|
|
11
|
+
export type APIHeaders = Record<string, string> | CustomHeaders | AxiosRequestConfig['headers'];
|
|
12
|
+
export declare enum APIError {
|
|
13
|
+
FORBIDDEN = "forbidden",
|
|
14
|
+
HTTP_EXCEPTION = "HttpException",
|
|
15
|
+
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
|
|
16
|
+
NOT_FOUND = "notFound",
|
|
17
|
+
UNAUTHORIZED = "unauthorized",
|
|
18
|
+
UNPROCESSABLE_ENTITY = "unprocessableEntity"
|
|
19
|
+
}
|
|
20
|
+
export declare enum ActionResult {
|
|
21
|
+
FAILURE = "failure",
|
|
22
|
+
SUCCESS = "success"
|
|
23
|
+
}
|
|
24
|
+
export declare enum Action {
|
|
25
|
+
CREATE = "create",
|
|
26
|
+
DELETE = "delete",
|
|
27
|
+
EXPORT = "export",
|
|
28
|
+
IMPORT = "import",
|
|
29
|
+
SIGN_IN = "signIn",
|
|
30
|
+
SIGN_OUT = "signOut",
|
|
31
|
+
SIGN_UP = "signUp",
|
|
32
|
+
UPDATE = "update"
|
|
33
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Action = exports.ActionResult = exports.APIError = exports.Order = exports.Language = void 0;
|
|
4
|
+
var Language;
|
|
5
|
+
(function (Language) {
|
|
6
|
+
Language["EN_US"] = "enUS";
|
|
7
|
+
Language["ZH_CN"] = "zhCN";
|
|
8
|
+
})(Language || (exports.Language = Language = {}));
|
|
9
|
+
var Order;
|
|
10
|
+
(function (Order) {
|
|
11
|
+
Order["ASC"] = "asc";
|
|
12
|
+
Order["DESC"] = "desc";
|
|
13
|
+
})(Order || (exports.Order = Order = {}));
|
|
14
|
+
var APIError;
|
|
15
|
+
(function (APIError) {
|
|
16
|
+
APIError["FORBIDDEN"] = "forbidden";
|
|
17
|
+
APIError["HTTP_EXCEPTION"] = "HttpException";
|
|
18
|
+
APIError["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR";
|
|
19
|
+
APIError["NOT_FOUND"] = "notFound";
|
|
20
|
+
APIError["UNAUTHORIZED"] = "unauthorized";
|
|
21
|
+
APIError["UNPROCESSABLE_ENTITY"] = "unprocessableEntity";
|
|
22
|
+
})(APIError || (exports.APIError = APIError = {}));
|
|
23
|
+
var ActionResult;
|
|
24
|
+
(function (ActionResult) {
|
|
25
|
+
ActionResult["FAILURE"] = "failure";
|
|
26
|
+
ActionResult["SUCCESS"] = "success";
|
|
27
|
+
})(ActionResult || (exports.ActionResult = ActionResult = {}));
|
|
28
|
+
var Action;
|
|
29
|
+
(function (Action) {
|
|
30
|
+
Action["CREATE"] = "create";
|
|
31
|
+
Action["DELETE"] = "delete";
|
|
32
|
+
Action["EXPORT"] = "export";
|
|
33
|
+
Action["IMPORT"] = "import";
|
|
34
|
+
Action["SIGN_IN"] = "signIn";
|
|
35
|
+
Action["SIGN_OUT"] = "signOut";
|
|
36
|
+
Action["SIGN_UP"] = "signUp";
|
|
37
|
+
Action["UPDATE"] = "update";
|
|
38
|
+
})(Action || (exports.Action = Action = {}));
|
|
39
|
+
//# sourceMappingURL=app.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.interface.js","sourceRoot":"","sources":["../src/app.interface.ts"],"names":[],"mappings":";;;AAEA,IAAY,QAGX;AAHD,WAAY,QAAQ;IAChB,0BAAc,CAAA;IACd,0BAAc,CAAA;AAClB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED,IAAY,KAGX;AAHD,WAAY,KAAK;IACb,oBAAW,CAAA;IACX,sBAAa,CAAA;AACjB,CAAC,EAHW,KAAK,qBAAL,KAAK,QAGhB;AAQD,IAAY,QAOX;AAPD,WAAY,QAAQ;IAChB,mCAAuB,CAAA;IACvB,4CAAgC,CAAA;IAChC,2DAA+C,CAAA;IAC/C,kCAAsB,CAAA;IACtB,yCAA6B,CAAA;IAC7B,wDAA4C,CAAA;AAChD,CAAC,EAPW,QAAQ,wBAAR,QAAQ,QAOnB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;AACvB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAED,IAAY,MASX;AATD,WAAY,MAAM;IACd,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;IACjB,4BAAkB,CAAA;IAClB,8BAAoB,CAAA;IACpB,4BAAkB,CAAA;IAClB,2BAAiB,CAAA;AACrB,CAAC,EATW,MAAM,sBAAN,MAAM,QASjB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { Reflector } from '@nestjs/core';
|
|
3
|
+
import { AuthService } from '../auth';
|
|
4
|
+
export declare class AuthGuard implements CanActivate {
|
|
5
|
+
private readonly authService;
|
|
6
|
+
private readonly reflector;
|
|
7
|
+
constructor(authService: AuthService, reflector: Reflector);
|
|
8
|
+
canActivate(context: ExecutionContext): true | Promise<boolean>;
|
|
9
|
+
}
|