@loopback/typeorm 0.9.3 → 0.9.4

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { Application, Binding, BindingScope, Component, LifeCycleObserver, MixinTarget } from '@loopback/core';
2
3
  import { Connection, ConnectionManager, ConnectionOptions } from 'typeorm';
3
4
  export declare function TypeOrmMixin<T extends MixinTarget<Application>>(superClass: T): {
@@ -74,6 +75,7 @@ export declare function TypeOrmMixin<T extends MixinTarget<Application>>(superCl
74
75
  (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): Application;
75
76
  (event: string | symbol, listener: (...args: any[]) => void): Application;
76
77
  };
78
+ [EventEmitter.captureRejectionSymbol]?: ((error: Error, event: string, ...args: any[]) => void) | undefined;
77
79
  addListener: (eventName: string | symbol, listener: (...args: any[]) => void) => Application;
78
80
  removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => Application;
79
81
  off: (eventName: string | symbol, listener: (...args: any[]) => void) => Application;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loopback/typeorm",
3
3
  "description": "Adds support for TypeORM in LoopBack",
4
- "version": "0.9.3",
4
+ "version": "0.9.4",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -43,17 +43,17 @@
43
43
  "typeorm": "^0.3.17"
44
44
  },
45
45
  "devDependencies": {
46
- "@loopback/boot": "^6.1.3",
47
- "@loopback/build": "^10.1.3",
48
- "@loopback/core": "^5.1.3",
49
- "@loopback/eslint-config": "^14.0.4",
50
- "@loopback/repository": "^6.1.3",
51
- "@loopback/rest": "^13.1.3",
52
- "@loopback/testlab": "^6.1.3",
53
- "@types/debug": "^4.1.8",
54
- "@types/json-schema": "^7.0.12",
55
- "@types/node": "^16.18.50",
46
+ "@loopback/boot": "^6.1.4",
47
+ "@loopback/build": "^10.1.4",
48
+ "@loopback/core": "^5.1.4",
49
+ "@loopback/eslint-config": "^14.0.5",
50
+ "@loopback/repository": "^6.1.4",
51
+ "@loopback/rest": "^13.1.4",
52
+ "@loopback/testlab": "^6.1.4",
53
+ "@types/debug": "^4.1.12",
54
+ "@types/json-schema": "^7.0.15",
55
+ "@types/node": "^16.18.68",
56
56
  "sqlite3": "^5.1.4"
57
57
  },
58
- "gitHead": "9107199cdf1597260ee03e2a903b7db0dec8445d"
58
+ "gitHead": "5326aa3ae03bd01b970917f96d0403dd5102aef1"
59
59
  }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- // Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
3
- // Node module: @loopback/typeorm
4
- // This file is licensed under the MIT License.
5
- // License text available at https://opensource.org/licenses/MIT
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TypeOrmApp = void 0;
8
- const boot_1 = require("@loopback/boot");
9
- const rest_1 = require("@loopback/rest");
10
- const __1 = require("../../");
11
- class TypeOrmApp extends (0, boot_1.BootMixin)((0, __1.TypeOrmMixin)(rest_1.RestApplication)) {
12
- constructor(options) {
13
- super(options);
14
- this.projectRoot = __dirname;
15
- }
16
- }
17
- exports.TypeOrmApp = TypeOrmApp;
18
- //# sourceMappingURL=application.js.map
19
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/typeorm/dist/__tests__/fixtures/application.js.map
@@ -1,19 +0,0 @@
1
- "use strict";
2
- // Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
3
- // Node module: @loopback/typeorm
4
- // This file is licensed under the MIT License.
5
- // License text available at https://opensource.org/licenses/MIT
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SqliteConnection = void 0;
8
- const tslib_1 = require("tslib");
9
- const path_1 = tslib_1.__importDefault(require("path"));
10
- const book_entity_1 = require("../typeorm-entities/book.entity");
11
- exports.SqliteConnection = {
12
- name: 'my-db',
13
- type: 'sqlite',
14
- database: path_1.default.join(__dirname, './mydb.sql'),
15
- entities: [book_entity_1.Book],
16
- synchronize: true,
17
- };
18
- //# sourceMappingURL=sqlite.connection.js.map
19
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/typeorm/dist/__tests__/fixtures/typeorm-connections/sqlite.connection.js.map
@@ -1,29 +0,0 @@
1
- "use strict";
2
- // Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
3
- // Node module: @loopback/typeorm
4
- // This file is licensed under the MIT License.
5
- // License text available at https://opensource.org/licenses/MIT
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Book = void 0;
8
- const tslib_1 = require("tslib");
9
- const __1 = require("../../../");
10
- let Book = class Book {
11
- };
12
- exports.Book = Book;
13
- tslib_1.__decorate([
14
- (0, __1.PrimaryGeneratedColumn)(),
15
- tslib_1.__metadata("design:type", Number)
16
- ], Book.prototype, "id", void 0);
17
- tslib_1.__decorate([
18
- (0, __1.Column)(),
19
- tslib_1.__metadata("design:type", String)
20
- ], Book.prototype, "title", void 0);
21
- tslib_1.__decorate([
22
- (0, __1.Column)(),
23
- tslib_1.__metadata("design:type", Boolean)
24
- ], Book.prototype, "published", void 0);
25
- exports.Book = Book = tslib_1.__decorate([
26
- (0, __1.Entity)()
27
- ], Book);
28
- //# sourceMappingURL=book.entity.js.map
29
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/typeorm/dist/__tests__/fixtures/typeorm-entities/book.entity.js.map
@@ -1,19 +0,0 @@
1
- "use strict";
2
- // Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
3
- // Node module: @loopback/typeorm
4
- // This file is licensed under the MIT License.
5
- // License text available at https://opensource.org/licenses/MIT
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TypeOrmApp = void 0;
8
- const boot_1 = require("@loopback/boot");
9
- const rest_1 = require("@loopback/rest");
10
- const __1 = require("../../");
11
- class TypeOrmApp extends (0, boot_1.BootMixin)((0, __1.TypeOrmMixin)(rest_1.RestApplication)) {
12
- constructor(options) {
13
- super(options);
14
- this.projectRoot = __dirname;
15
- }
16
- }
17
- exports.TypeOrmApp = TypeOrmApp;
18
- //# sourceMappingURL=application.js.map
19
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/typeorm/dist/__tests__/fixtures/application.js.map
@@ -1,71 +0,0 @@
1
- "use strict";
2
- // Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
3
- // Node module: @loopback/typeorm
4
- // This file is licensed under the MIT License.
5
- // License text available at https://opensource.org/licenses/MIT
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.BookController = void 0;
8
- const tslib_1 = require("tslib");
9
- const rest_1 = require("@loopback/rest");
10
- const __1 = require("../../../");
11
- const book_entity_1 = require("../typeorm-entities/book.entity");
12
- class BookController {
13
- constructor() { }
14
- async create(data) {
15
- const bookEntity = new book_entity_1.Book();
16
- bookEntity.title = data.title;
17
- bookEntity.published = data.published;
18
- return this.bookRepo.save(bookEntity);
19
- }
20
- async findById(id) {
21
- return this.bookRepo.findOne({ where: { id } });
22
- }
23
- }
24
- exports.BookController = BookController;
25
- tslib_1.__decorate([
26
- __1.typeorm.repository(book_entity_1.Book, 'my-db'),
27
- tslib_1.__metadata("design:type", __1.Repository)
28
- ], BookController.prototype, "bookRepo", void 0);
29
- tslib_1.__decorate([
30
- (0, rest_1.post)('/books', {
31
- responses: {
32
- '200': {
33
- description: 'User model instance',
34
- content: { 'application/json': { schema: (0, __1.getModelSchema)(book_entity_1.Book) } },
35
- },
36
- },
37
- }),
38
- tslib_1.__param(0, (0, rest_1.requestBody)({
39
- content: {
40
- 'application/json': {
41
- schema: (0, __1.getModelSchema)(book_entity_1.Book, {
42
- title: 'NewUser',
43
- exclude: ['id'],
44
- }),
45
- },
46
- },
47
- })),
48
- tslib_1.__metadata("design:type", Function),
49
- tslib_1.__metadata("design:paramtypes", [Object]),
50
- tslib_1.__metadata("design:returntype", Promise)
51
- ], BookController.prototype, "create", null);
52
- tslib_1.__decorate([
53
- (0, rest_1.get)('/books/{id}', {
54
- responses: {
55
- '200': {
56
- description: 'User model instance',
57
- content: {
58
- 'application/json': {
59
- schema: (0, __1.getModelSchema)(book_entity_1.Book, { includeRelations: true }),
60
- },
61
- },
62
- },
63
- },
64
- }),
65
- tslib_1.__param(0, rest_1.param.path.number('id')),
66
- tslib_1.__metadata("design:type", Function),
67
- tslib_1.__metadata("design:paramtypes", [Number]),
68
- tslib_1.__metadata("design:returntype", Promise)
69
- ], BookController.prototype, "findById", null);
70
- //# sourceMappingURL=book.controller.js.map
71
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/typeorm/dist/__tests__/fixtures/controllers/book.controller.js.map
@@ -1,19 +0,0 @@
1
- "use strict";
2
- // Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
3
- // Node module: @loopback/typeorm
4
- // This file is licensed under the MIT License.
5
- // License text available at https://opensource.org/licenses/MIT
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SqliteConnection = void 0;
8
- const tslib_1 = require("tslib");
9
- const path_1 = tslib_1.__importDefault(require("path"));
10
- const book_entity_1 = require("../typeorm-entities/book.entity");
11
- exports.SqliteConnection = {
12
- name: 'my-db',
13
- type: 'sqlite',
14
- database: path_1.default.join(__dirname, './mydb.sql'),
15
- entities: [book_entity_1.Book],
16
- synchronize: true,
17
- };
18
- //# sourceMappingURL=sqlite.connection.js.map
19
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/typeorm/dist/__tests__/fixtures/typeorm-connections/sqlite.connection.js.map
@@ -1,29 +0,0 @@
1
- "use strict";
2
- // Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
3
- // Node module: @loopback/typeorm
4
- // This file is licensed under the MIT License.
5
- // License text available at https://opensource.org/licenses/MIT
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Book = void 0;
8
- const tslib_1 = require("tslib");
9
- const __1 = require("../../../");
10
- let Book = class Book {
11
- };
12
- exports.Book = Book;
13
- tslib_1.__decorate([
14
- (0, __1.PrimaryGeneratedColumn)(),
15
- tslib_1.__metadata("design:type", Number)
16
- ], Book.prototype, "id", void 0);
17
- tslib_1.__decorate([
18
- (0, __1.Column)(),
19
- tslib_1.__metadata("design:type", String)
20
- ], Book.prototype, "title", void 0);
21
- tslib_1.__decorate([
22
- (0, __1.Column)(),
23
- tslib_1.__metadata("design:type", Boolean)
24
- ], Book.prototype, "published", void 0);
25
- exports.Book = Book = tslib_1.__decorate([
26
- (0, __1.Entity)()
27
- ], Book);
28
- //# sourceMappingURL=book.entity.js.map
29
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/typeorm/dist/__tests__/fixtures/typeorm-entities/book.entity.js.map