@loopback/typeorm 0.7.4 → 0.7.6

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.
@@ -0,0 +1,19 @@
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
@@ -0,0 +1,19 @@
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
@@ -0,0 +1,29 @@
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
+ tslib_1.__decorate([
13
+ (0, __1.PrimaryGeneratedColumn)(),
14
+ tslib_1.__metadata("design:type", Number)
15
+ ], Book.prototype, "id", void 0);
16
+ tslib_1.__decorate([
17
+ (0, __1.Column)(),
18
+ tslib_1.__metadata("design:type", String)
19
+ ], Book.prototype, "title", void 0);
20
+ tslib_1.__decorate([
21
+ (0, __1.Column)(),
22
+ tslib_1.__metadata("design:type", Boolean)
23
+ ], Book.prototype, "published", void 0);
24
+ Book = tslib_1.__decorate([
25
+ (0, __1.Entity)()
26
+ ], Book);
27
+ exports.Book = 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
@@ -0,0 +1,19 @@
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
@@ -0,0 +1,71 @@
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
+ tslib_1.__decorate([
25
+ __1.typeorm.repository(book_entity_1.Book, 'my-db'),
26
+ tslib_1.__metadata("design:type", __1.Repository)
27
+ ], BookController.prototype, "bookRepo", void 0);
28
+ tslib_1.__decorate([
29
+ (0, rest_1.post)('/books', {
30
+ responses: {
31
+ '200': {
32
+ description: 'User model instance',
33
+ content: { 'application/json': { schema: (0, __1.getModelSchema)(book_entity_1.Book) } },
34
+ },
35
+ },
36
+ }),
37
+ tslib_1.__param(0, (0, rest_1.requestBody)({
38
+ content: {
39
+ 'application/json': {
40
+ schema: (0, __1.getModelSchema)(book_entity_1.Book, {
41
+ title: 'NewUser',
42
+ exclude: ['id'],
43
+ }),
44
+ },
45
+ },
46
+ })),
47
+ tslib_1.__metadata("design:type", Function),
48
+ tslib_1.__metadata("design:paramtypes", [Object]),
49
+ tslib_1.__metadata("design:returntype", Promise)
50
+ ], BookController.prototype, "create", null);
51
+ tslib_1.__decorate([
52
+ (0, rest_1.get)('/books/{id}', {
53
+ responses: {
54
+ '200': {
55
+ description: 'User model instance',
56
+ content: {
57
+ 'application/json': {
58
+ schema: (0, __1.getModelSchema)(book_entity_1.Book, { includeRelations: true }),
59
+ },
60
+ },
61
+ },
62
+ },
63
+ }),
64
+ tslib_1.__param(0, rest_1.param.path.number('id')),
65
+ tslib_1.__metadata("design:type", Function),
66
+ tslib_1.__metadata("design:paramtypes", [Number]),
67
+ tslib_1.__metadata("design:returntype", Promise)
68
+ ], BookController.prototype, "findById", null);
69
+ exports.BookController = BookController;
70
+ //# sourceMappingURL=book.controller.js.map
71
+ //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/typeorm/dist/__tests__/fixtures/controllers/book.controller.js.map
@@ -0,0 +1,19 @@
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
@@ -0,0 +1,29 @@
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
+ tslib_1.__decorate([
13
+ (0, __1.PrimaryGeneratedColumn)(),
14
+ tslib_1.__metadata("design:type", Number)
15
+ ], Book.prototype, "id", void 0);
16
+ tslib_1.__decorate([
17
+ (0, __1.Column)(),
18
+ tslib_1.__metadata("design:type", String)
19
+ ], Book.prototype, "title", void 0);
20
+ tslib_1.__decorate([
21
+ (0, __1.Column)(),
22
+ tslib_1.__metadata("design:type", Boolean)
23
+ ], Book.prototype, "published", void 0);
24
+ Book = tslib_1.__decorate([
25
+ (0, __1.Entity)()
26
+ ], Book);
27
+ exports.Book = 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
@@ -93,7 +93,7 @@ export interface ApplicationUsingTypeOrm extends Application {
93
93
  connection(options: ConnectionOptions): void;
94
94
  migrateSchema(): Promise<void>;
95
95
  }
96
- export declare type TypeOrmComponentOptions = {
96
+ export type TypeOrmComponentOptions = {
97
97
  [prop: string]: string;
98
98
  };
99
99
  export declare class TypeOrmComponent implements Component {
@@ -10,10 +10,10 @@ import { ColumnType } from 'typeorm/driver/types/ColumnTypes';
10
10
  export declare function getModelSchema<T extends object>(modelCtor: Function & {
11
11
  prototype: T;
12
12
  }, options?: JsonSchemaOptions<T>): SchemaObject;
13
- export declare type PropertyType = {
13
+ export type PropertyType = {
14
14
  [propertyName: string]: SchemaObject | ReferenceObject;
15
15
  };
16
- export declare type StringifiedTypeOptions = {
16
+ export type StringifiedTypeOptions = {
17
17
  func: ColumnType;
18
18
  entity: string;
19
19
  property: string;
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.7.4",
4
+ "version": "0.7.6",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -33,27 +33,27 @@
33
33
  "!*/__tests__"
34
34
  ],
35
35
  "peerDependencies": {
36
- "@loopback/boot": "^5.0.4",
37
- "@loopback/core": "^4.0.4",
38
- "@loopback/rest": "^12.0.4"
36
+ "@loopback/boot": "^5.0.6",
37
+ "@loopback/core": "^4.0.6",
38
+ "@loopback/rest": "^12.0.6"
39
39
  },
40
40
  "dependencies": {
41
41
  "debug": "^4.3.4",
42
- "tslib": "^2.4.0",
43
- "typeorm": "^0.3.10"
42
+ "tslib": "^2.4.1",
43
+ "typeorm": "^0.3.11"
44
44
  },
45
45
  "devDependencies": {
46
- "@loopback/boot": "^5.0.4",
47
- "@loopback/build": "^9.0.4",
48
- "@loopback/core": "^4.0.4",
49
- "@loopback/eslint-config": "^13.0.4",
50
- "@loopback/repository": "^5.0.4",
51
- "@loopback/rest": "^12.0.4",
52
- "@loopback/testlab": "^5.0.4",
46
+ "@loopback/boot": "^5.0.6",
47
+ "@loopback/build": "^9.0.6",
48
+ "@loopback/core": "^4.0.6",
49
+ "@loopback/eslint-config": "^13.0.6",
50
+ "@loopback/repository": "^5.1.1",
51
+ "@loopback/rest": "^12.0.6",
52
+ "@loopback/testlab": "^5.0.6",
53
53
  "@types/debug": "^4.1.7",
54
54
  "@types/json-schema": "^7.0.11",
55
- "@types/node": "^14.18.32",
56
- "sqlite3": "^5.1.2"
55
+ "@types/node": "^14.18.34",
56
+ "sqlite3": "^5.1.4"
57
57
  },
58
- "gitHead": "947500110c84ba77b2197b759b559c195cfce260"
58
+ "gitHead": "709a5ecd1ffddeb02262cecabf7b663c7b4d7e47"
59
59
  }