tspace-spear 1.2.8 → 1.2.9-beta.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/README.md +303 -82
- package/dist/cli/app.d.ts +1 -1
- package/dist/cli/app.js +3 -7
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/controller.d.ts +1 -1
- package/dist/cli/controller.js +1 -12
- package/dist/cli/controller.js.map +1 -1
- package/dist/cli/generators/app/index.js +1 -1
- package/dist/cli/generators/app/index.js.map +1 -1
- package/dist/cli/generators/controller/template.d.ts +1 -1
- package/dist/cli/generators/controller/template.js +16 -7
- package/dist/cli/generators/controller/template.js.map +1 -1
- package/dist/cli/generators/dto/index.js +5 -3
- package/dist/cli/generators/dto/index.js.map +1 -1
- package/dist/cli/generators/module/index.js +3 -3
- package/dist/cli/generators/service/template.d.ts +1 -1
- package/dist/cli/generators/service/template.js +17 -17
- package/dist/cli/index.js +10 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/core/client/index.d.ts +13 -43
- package/dist/lib/core/client/index.js +70 -33
- package/dist/lib/core/client/index.js.map +1 -1
- package/dist/lib/core/client/types.d.ts +43 -0
- package/dist/lib/core/client/types.js +3 -0
- package/dist/lib/core/client/types.js.map +1 -0
- package/dist/lib/core/compiler/generator.d.ts +4 -6
- package/dist/lib/core/compiler/generator.js +172 -39
- package/dist/lib/core/compiler/generator.js.map +1 -1
- package/dist/lib/core/compiler/index.d.ts +2 -2
- package/dist/lib/core/compiler/index.js +2 -2
- package/dist/lib/core/compiler/index.js.map +1 -1
- package/dist/lib/core/compiler/pre-routes.d.ts +12 -130
- package/dist/lib/core/compiler/pre-routes.js +13 -35
- package/dist/lib/core/compiler/pre-routes.js.map +1 -1
- package/dist/lib/core/compiler/types.d.ts +25 -0
- package/dist/lib/core/decorators/context.js +23 -15
- package/dist/lib/core/decorators/context.js.map +1 -1
- package/dist/lib/core/decorators/controller.js +2 -1
- package/dist/lib/core/decorators/controller.js.map +1 -1
- package/dist/lib/core/decorators/index.d.ts +1 -0
- package/dist/lib/core/decorators/index.js +1 -0
- package/dist/lib/core/decorators/index.js.map +1 -1
- package/dist/lib/core/decorators/methods.js +4 -3
- package/dist/lib/core/decorators/methods.js.map +1 -1
- package/dist/lib/core/decorators/middleware.d.ts +40 -2
- package/dist/lib/core/decorators/middleware.js +54 -9
- package/dist/lib/core/decorators/middleware.js.map +1 -1
- package/dist/lib/core/decorators/service.d.ts +28 -0
- package/dist/lib/core/decorators/service.js +36 -0
- package/dist/lib/core/decorators/service.js.map +1 -0
- package/dist/lib/core/decorators/statusCode.js +3 -1
- package/dist/lib/core/decorators/statusCode.js.map +1 -1
- package/dist/lib/core/decorators/swagger.js +4 -3
- package/dist/lib/core/decorators/swagger.js.map +1 -1
- package/dist/lib/core/exception/index.d.ts +68 -0
- package/dist/lib/core/exception/index.js +123 -0
- package/dist/lib/core/exception/index.js.map +1 -0
- package/dist/lib/core/metadata/index.d.ts +6 -0
- package/dist/lib/core/metadata/index.js +13 -0
- package/dist/lib/core/metadata/index.js.map +1 -0
- package/dist/lib/core/server/fast-router.d.ts +2 -2
- package/dist/lib/core/server/fast-router.js +17 -3
- package/dist/lib/core/server/fast-router.js.map +1 -1
- package/dist/lib/core/server/index.d.ts +32 -5
- package/dist/lib/core/server/index.js +188 -45
- package/dist/lib/core/server/index.js.map +1 -1
- package/dist/lib/core/server/parser-factory.js +59 -10
- package/dist/lib/core/server/parser-factory.js.map +1 -1
- package/dist/lib/core/server/response.js +21 -1
- package/dist/lib/core/server/response.js.map +1 -1
- package/dist/lib/core/types/index.d.ts +42 -29
- package/package.json +14 -5
- package/dist/cli/client.d.ts +0 -1
- package/dist/cli/client.js +0 -30
- package/dist/cli/client.js.map +0 -1
- package/dist/cli/middleware.d.ts +0 -1
- package/dist/cli/middleware.js +0 -16
- package/dist/cli/middleware.js.map +0 -1
- package/dist/client.d.ts +0 -1
- package/dist/client.js +0 -17
- package/dist/client.js.map +0 -1
- package/dist/common/middlewares/log.middleware.d.ts +0 -2
- package/dist/common/middlewares/log.middleware.js +0 -12
- package/dist/common/middlewares/log.middleware.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -32
- package/dist/index.js.map +0 -1
- package/dist/modules/cats/cat.controller.d.ts +0 -58
- package/dist/modules/cats/cat.controller.js +0 -90
- package/dist/modules/cats/cat.controller.js.map +0 -1
- package/dist/modules/cats/cat.dto.d.ts +0 -8
- package/dist/modules/cats/cat.dto.js +0 -44
- package/dist/modules/cats/cat.dto.js.map +0 -1
- package/dist/modules/cats/cat.service.d.ts +0 -23
- package/dist/modules/cats/cat.service.js +0 -56
- package/dist/modules/cats/cat.service.js.map +0 -1
- package/dist/tests/e2e..test.d.ts +0 -1
- package/dist/tests/e2e..test.js +0 -16
- package/dist/tests/e2e..test.js.map +0 -1
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { type T } from "tspace-spear";
|
|
2
|
-
import { CatService } from "./cat.service.ts";
|
|
3
|
-
import { CreateCatDto, UpdateCatDto } from "./cat.dto.ts";
|
|
4
|
-
declare class CatController {
|
|
5
|
-
private catService;
|
|
6
|
-
constructor(catService?: CatService);
|
|
7
|
-
index(): Promise<{
|
|
8
|
-
id: number;
|
|
9
|
-
name: string;
|
|
10
|
-
age: number;
|
|
11
|
-
}[]>;
|
|
12
|
-
show({ params }: T.Context<{
|
|
13
|
-
params: {
|
|
14
|
-
id: number;
|
|
15
|
-
};
|
|
16
|
-
}>): Promise<{
|
|
17
|
-
id: number;
|
|
18
|
-
name: string;
|
|
19
|
-
age: number;
|
|
20
|
-
} | undefined>;
|
|
21
|
-
create({ body }: T.Context<{
|
|
22
|
-
body: CreateCatDto;
|
|
23
|
-
}>): Promise<{
|
|
24
|
-
message: string;
|
|
25
|
-
cat: {
|
|
26
|
-
id: number;
|
|
27
|
-
name: string;
|
|
28
|
-
age: number;
|
|
29
|
-
};
|
|
30
|
-
}>;
|
|
31
|
-
update({ params, body }: T.Context<{
|
|
32
|
-
params: {
|
|
33
|
-
id: number;
|
|
34
|
-
};
|
|
35
|
-
body: UpdateCatDto;
|
|
36
|
-
}>): Promise<{
|
|
37
|
-
message: string;
|
|
38
|
-
cat: {
|
|
39
|
-
id: number;
|
|
40
|
-
name: string;
|
|
41
|
-
age: number;
|
|
42
|
-
};
|
|
43
|
-
}>;
|
|
44
|
-
remove({ params }: T.Context<{
|
|
45
|
-
params: {
|
|
46
|
-
id: number;
|
|
47
|
-
};
|
|
48
|
-
}>): Promise<{
|
|
49
|
-
message: string;
|
|
50
|
-
cat: {
|
|
51
|
-
id: number;
|
|
52
|
-
name: string;
|
|
53
|
-
age: number;
|
|
54
|
-
};
|
|
55
|
-
}>;
|
|
56
|
-
}
|
|
57
|
-
export { CatController };
|
|
58
|
-
export default CatController;
|
|
@@ -1,90 +0,0 @@
|
|
|
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.CatController = void 0;
|
|
13
|
-
const tspace_spear_1 = require("tspace-spear");
|
|
14
|
-
const cat_service_ts_1 = require("./cat.service.ts");
|
|
15
|
-
const cat_dto_ts_1 = require("./cat.dto.ts");
|
|
16
|
-
const log_middleware_1 = require("../../common/middlewares/log.middleware");
|
|
17
|
-
let CatController = class CatController {
|
|
18
|
-
catService;
|
|
19
|
-
constructor(catService = new cat_service_ts_1.CatService()) {
|
|
20
|
-
this.catService = catService;
|
|
21
|
-
}
|
|
22
|
-
async index() {
|
|
23
|
-
return this.catService.index();
|
|
24
|
-
}
|
|
25
|
-
async show({ params }) {
|
|
26
|
-
return this.catService.show(params.id);
|
|
27
|
-
}
|
|
28
|
-
async create({ body }) {
|
|
29
|
-
return this.catService
|
|
30
|
-
.create({
|
|
31
|
-
name: body.name,
|
|
32
|
-
age: body.age
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
async update({ params, body }) {
|
|
36
|
-
return this.catService
|
|
37
|
-
.update(params.id, {
|
|
38
|
-
name: body.name,
|
|
39
|
-
age: body.age
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
async remove({ params }) {
|
|
43
|
-
return this.catService
|
|
44
|
-
.remove(params.id);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
exports.CatController = CatController;
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, tspace_spear_1.Get)("/"),
|
|
50
|
-
(0, tspace_spear_1.Middleware)(log_middleware_1.LogMiddleware),
|
|
51
|
-
__metadata("design:type", Function),
|
|
52
|
-
__metadata("design:paramtypes", []),
|
|
53
|
-
__metadata("design:returntype", Promise)
|
|
54
|
-
], CatController.prototype, "index", null);
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, tspace_spear_1.Get)("/:id"),
|
|
57
|
-
(0, tspace_spear_1.Middleware)(log_middleware_1.LogMiddleware),
|
|
58
|
-
__metadata("design:type", Function),
|
|
59
|
-
__metadata("design:paramtypes", [Object]),
|
|
60
|
-
__metadata("design:returntype", Promise)
|
|
61
|
-
], CatController.prototype, "show", null);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, tspace_spear_1.Post)("/"),
|
|
64
|
-
(0, tspace_spear_1.ValidateDto)(cat_dto_ts_1.CreateCatDto),
|
|
65
|
-
(0, tspace_spear_1.Middleware)(log_middleware_1.LogMiddleware),
|
|
66
|
-
__metadata("design:type", Function),
|
|
67
|
-
__metadata("design:paramtypes", [Object]),
|
|
68
|
-
__metadata("design:returntype", Promise)
|
|
69
|
-
], CatController.prototype, "create", null);
|
|
70
|
-
__decorate([
|
|
71
|
-
(0, tspace_spear_1.Put)("/:id"),
|
|
72
|
-
(0, tspace_spear_1.ValidateDto)(cat_dto_ts_1.UpdateCatDto),
|
|
73
|
-
(0, tspace_spear_1.Middleware)(log_middleware_1.LogMiddleware),
|
|
74
|
-
__metadata("design:type", Function),
|
|
75
|
-
__metadata("design:paramtypes", [Object]),
|
|
76
|
-
__metadata("design:returntype", Promise)
|
|
77
|
-
], CatController.prototype, "update", null);
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, tspace_spear_1.Delete)("/:id"),
|
|
80
|
-
(0, tspace_spear_1.Middleware)(log_middleware_1.LogMiddleware),
|
|
81
|
-
__metadata("design:type", Function),
|
|
82
|
-
__metadata("design:paramtypes", [Object]),
|
|
83
|
-
__metadata("design:returntype", Promise)
|
|
84
|
-
], CatController.prototype, "remove", null);
|
|
85
|
-
exports.CatController = CatController = __decorate([
|
|
86
|
-
(0, tspace_spear_1.Controller)("/cats"),
|
|
87
|
-
__metadata("design:paramtypes", [cat_service_ts_1.CatService])
|
|
88
|
-
], CatController);
|
|
89
|
-
exports.default = CatController;
|
|
90
|
-
//# sourceMappingURL=cat.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat.controller.js","sourceRoot":"","sources":["../../../src/modules/cats/cat.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CASsB;AACtB,qDAAiD;AACjD,6CAA4D;AAC5D,4EAAwE;AAExE,IACM,aAAa,GADnB,MACM,aAAa;IAGP;IADV,YACU,aAAyB,IAAI,2BAAU,EAAE;QAAzC,eAAU,GAAV,UAAU,CAA+B;IAChD,CAAC;IAIE,A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IACzB,IAAA,yBAAU,EAAC,8BAAa,CAAC;;;;2CAgBzB;AAIK;IAFL,IAAA,qBAAM,EAAC,MAAM,CAAC;IACd,IAAA,yBAAU,EAAC,8BAAa,CAAC;;;;2CAWzB;wBAzEG,aAAa;IADlB,IAAA,yBAAU,EAAC,OAAO,CAAC;qCAII,2BAAU;GAH5B,aAAa,CA0ElB;AAGD,kBAAe,aAAa,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
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.UpdateCatDto = exports.CreateCatDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class CreateCatDto {
|
|
15
|
-
name;
|
|
16
|
-
age;
|
|
17
|
-
}
|
|
18
|
-
exports.CreateCatDto = CreateCatDto;
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, class_validator_1.IsString)(),
|
|
21
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
22
|
-
__metadata("design:type", String)
|
|
23
|
-
], CreateCatDto.prototype, "name", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, class_validator_1.IsNumber)(),
|
|
26
|
-
(0, class_validator_1.Min)(0.1),
|
|
27
|
-
__metadata("design:type", Number)
|
|
28
|
-
], CreateCatDto.prototype, "age", void 0);
|
|
29
|
-
class UpdateCatDto {
|
|
30
|
-
name;
|
|
31
|
-
age;
|
|
32
|
-
}
|
|
33
|
-
exports.UpdateCatDto = UpdateCatDto;
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, class_validator_1.IsString)(),
|
|
36
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
37
|
-
__metadata("design:type", String)
|
|
38
|
-
], UpdateCatDto.prototype, "name", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, class_validator_1.IsNumber)(),
|
|
41
|
-
(0, class_validator_1.Min)(0.1),
|
|
42
|
-
__metadata("design:type", Number)
|
|
43
|
-
], UpdateCatDto.prototype, "age", void 0);
|
|
44
|
-
//# sourceMappingURL=cat.dto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat.dto.js","sourceRoot":"","sources":["../../../src/modules/cats/cat.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qDAKyB;AAEzB,MAAa,YAAY;IAGvB,IAAI,CAAU;IAId,GAAG,CAAU;CACd;AARD,oCAQC;AALC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0CACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,GAAG,CAAC;;yCACI;AAGf,MAAa,YAAY;IAGvB,IAAI,CAAU;IAId,GAAG,CAAU;CACd;AARD,oCAQC;AALC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0CACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,GAAG,CAAC;;yCACI"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
type Cat = {
|
|
2
|
-
id: number;
|
|
3
|
-
name: string;
|
|
4
|
-
age: number;
|
|
5
|
-
};
|
|
6
|
-
export declare class CatService {
|
|
7
|
-
private cats;
|
|
8
|
-
index(): Promise<Cat[]>;
|
|
9
|
-
show(id: number): Promise<Cat | undefined>;
|
|
10
|
-
create({ name, age }: Omit<Cat, "id">): Promise<{
|
|
11
|
-
message: string;
|
|
12
|
-
cat: Cat;
|
|
13
|
-
}>;
|
|
14
|
-
update(id: number, { name, age }: Omit<Cat, "id">): Promise<{
|
|
15
|
-
message: string;
|
|
16
|
-
cat: Cat;
|
|
17
|
-
}>;
|
|
18
|
-
remove(id: number): Promise<{
|
|
19
|
-
message: string;
|
|
20
|
-
cat: Cat;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CatService = void 0;
|
|
4
|
-
class CatService {
|
|
5
|
-
cats = [
|
|
6
|
-
{ id: 1, name: 'cat1', age: 1.6 },
|
|
7
|
-
{ id: 2, name: 'cat2', age: 1.8 },
|
|
8
|
-
];
|
|
9
|
-
async index() {
|
|
10
|
-
return this.cats;
|
|
11
|
-
}
|
|
12
|
-
;
|
|
13
|
-
async show(id) {
|
|
14
|
-
return this.cats.find(cat => cat.id === id);
|
|
15
|
-
}
|
|
16
|
-
;
|
|
17
|
-
async create({ name, age }) {
|
|
18
|
-
const cat = {
|
|
19
|
-
id: this.cats.length + 1,
|
|
20
|
-
name: name,
|
|
21
|
-
age: age
|
|
22
|
-
};
|
|
23
|
-
this.cats.push(cat);
|
|
24
|
-
return {
|
|
25
|
-
message: "Created",
|
|
26
|
-
cat
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
async update(id, { name, age }) {
|
|
30
|
-
const index = this.cats.findIndex(d => d.id === id);
|
|
31
|
-
if (index === -1) {
|
|
32
|
-
throw new Error("Cat not found");
|
|
33
|
-
}
|
|
34
|
-
this.cats[index] = {
|
|
35
|
-
...this.cats[index],
|
|
36
|
-
...{ name, age }
|
|
37
|
-
};
|
|
38
|
-
return {
|
|
39
|
-
message: "Updated",
|
|
40
|
-
cat: this.cats[index]
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
async remove(id) {
|
|
44
|
-
const index = this.cats.findIndex(d => d.id === id);
|
|
45
|
-
if (index === -1) {
|
|
46
|
-
throw new Error("Cat not found");
|
|
47
|
-
}
|
|
48
|
-
const [removedCat] = this.cats.splice(index, 1);
|
|
49
|
-
return {
|
|
50
|
-
message: "Deleted",
|
|
51
|
-
cat: removedCat
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.CatService = CatService;
|
|
56
|
-
//# sourceMappingURL=cat.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat.service.js","sourceRoot":"","sources":["../../../src/modules/cats/cat.service.ts"],"names":[],"mappings":";;;AAOA,MAAa,UAAU;IACX,IAAI,GAAU;QAClB,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE;QACjC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE;KACpC,CAAC;IACK,KAAK,CAAC,KAAK;QACd,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAAA,CAAC;IAEK,KAAK,CAAC,IAAI,CAAC,EAAU;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;IAAA,CAAC;IAEK,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAmB;QAE9C,MAAM,GAAG,GAAQ;YACb,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YACxB,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,GAAG;SACX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dist/tests/e2e..test.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const chai_1 = __importDefault(require("chai"));
|
|
7
|
-
const mocha_1 = require("mocha");
|
|
8
|
-
const chai_json_schema_1 = __importDefault(require("chai-json-schema"));
|
|
9
|
-
chai_1.default.use(chai_json_schema_1.default);
|
|
10
|
-
(0, mocha_1.describe)('Testing Driver', function () {
|
|
11
|
-
/* ##################################################### */
|
|
12
|
-
(0, mocha_1.it)(`Driver: Using driver in ['mysql','postgres' ,'mariadb','mssql','sqlite'] ?`, async function () {
|
|
13
|
-
});
|
|
14
|
-
/* ###################################################### */
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=e2e..test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"e2e..test.js","sourceRoot":"","sources":["../../src/tests/e2e..test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAoC;AACpC,iCAAoC;AACpC,wEAA6C;AAE7C,cAAI,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAA;AAExB,IAAA,gBAAQ,EAAC,gBAAgB,EAAE;IACzB,2DAA2D;IAC3D,IAAA,UAAE,EAAC,4EAA4E,EAC/E,KAAK;IACL,CAAC,CAAC,CAAA;IACF,4DAA4D;AAC9D,CAAC,CAAC,CAAA"}
|