@loopback/sequelize 0.5.2 → 0.5.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.
- package/dist/sequelize/sequelize.datasource.base.d.ts +1 -1
- package/dist/sequelize/sequelize.datasource.base.js +2 -3
- package/dist/sequelize/sequelize.datasource.base.js.map +1 -1
- package/dist/sequelize/sequelize.repository.base.d.ts +19 -4
- package/dist/sequelize/sequelize.repository.base.js +26 -6
- package/dist/sequelize/sequelize.repository.base.js.map +1 -1
- package/dist/sequelize/utils.d.ts +8 -0
- package/dist/sequelize/utils.js +21 -1
- package/dist/sequelize/utils.js.map +1 -1
- package/package.json +13 -11
- package/src/sequelize/sequelize.datasource.base.ts +4 -5
- package/src/sequelize/sequelize.repository.base.ts +58 -14
- package/src/sequelize/utils.ts +18 -0
- package/dist/.sandbox/23319CTsyje/application.js +0 -15
- package/dist/.sandbox/23319CTsyje/controllers/book-category.controller.js +0 -41
- package/dist/.sandbox/23319CTsyje/controllers/book.controller.js +0 -210
- package/dist/.sandbox/23319CTsyje/controllers/category.controller.js +0 -198
- package/dist/.sandbox/23319CTsyje/controllers/developer.controller.js +0 -177
- package/dist/.sandbox/23319CTsyje/controllers/doctor-patient.controller.js +0 -112
- package/dist/.sandbox/23319CTsyje/controllers/doctor.controller.js +0 -177
- package/dist/.sandbox/23319CTsyje/controllers/index.js +0 -23
- package/dist/.sandbox/23319CTsyje/controllers/patient.controller.js +0 -165
- package/dist/.sandbox/23319CTsyje/controllers/product.controller.js +0 -177
- package/dist/.sandbox/23319CTsyje/controllers/programming-languange.controller.js +0 -204
- package/dist/.sandbox/23319CTsyje/controllers/task.controller.js +0 -210
- package/dist/.sandbox/23319CTsyje/controllers/test.controller.base.js +0 -27
- package/dist/.sandbox/23319CTsyje/controllers/todo-list-todo.controller.js +0 -113
- package/dist/.sandbox/23319CTsyje/controllers/todo-list.controller.js +0 -177
- package/dist/.sandbox/23319CTsyje/controllers/todo-todo-list.controller.js +0 -41
- package/dist/.sandbox/23319CTsyje/controllers/todo.controller.js +0 -177
- package/dist/.sandbox/23319CTsyje/controllers/transaction.controller.js +0 -157
- package/dist/.sandbox/23319CTsyje/controllers/user-todo-list.controller.js +0 -113
- package/dist/.sandbox/23319CTsyje/controllers/user.controller.js +0 -210
- package/dist/.sandbox/23319CTsyje/datasources/config.js +0 -65
- package/dist/.sandbox/23319CTsyje/datasources/primary.datasource.js +0 -28
- package/dist/.sandbox/23319CTsyje/datasources/secondary.datasource.js +0 -28
- package/dist/.sandbox/23319CTsyje/models/appointment.model.js +0 -37
- package/dist/.sandbox/23319CTsyje/models/book.model.js +0 -48
- package/dist/.sandbox/23319CTsyje/models/category.model.js +0 -32
- package/dist/.sandbox/23319CTsyje/models/developer.model.js +0 -47
- package/dist/.sandbox/23319CTsyje/models/doctor.model.js +0 -44
- package/dist/.sandbox/23319CTsyje/models/index.js +0 -17
- package/dist/.sandbox/23319CTsyje/models/patient.model.js +0 -32
- package/dist/.sandbox/23319CTsyje/models/product.model.js +0 -41
- package/dist/.sandbox/23319CTsyje/models/programming-language.model.js +0 -39
- package/dist/.sandbox/23319CTsyje/models/task.model.js +0 -74
- package/dist/.sandbox/23319CTsyje/models/todo-list.model.js +0 -45
- package/dist/.sandbox/23319CTsyje/models/todo.model.js +0 -44
- package/dist/.sandbox/23319CTsyje/models/user.model.js +0 -92
- package/dist/.sandbox/23319CTsyje/repositories/appointment.repository.js +0 -20
- package/dist/.sandbox/23319CTsyje/repositories/book.repository.js +0 -25
- package/dist/.sandbox/23319CTsyje/repositories/category.repository.js +0 -20
- package/dist/.sandbox/23319CTsyje/repositories/developer.repository.js +0 -25
- package/dist/.sandbox/23319CTsyje/repositories/doctor.repository.js +0 -27
- package/dist/.sandbox/23319CTsyje/repositories/index.js +0 -17
- package/dist/.sandbox/23319CTsyje/repositories/patient.repository.js +0 -20
- package/dist/.sandbox/23319CTsyje/repositories/product.repository.js +0 -20
- package/dist/.sandbox/23319CTsyje/repositories/programming-language.repository.js +0 -20
- package/dist/.sandbox/23319CTsyje/repositories/task.repository.js +0 -26
- package/dist/.sandbox/23319CTsyje/repositories/todo-list.repository.js +0 -25
- package/dist/.sandbox/23319CTsyje/repositories/todo.repository.js +0 -25
- package/dist/.sandbox/23319CTsyje/repositories/user.repository.js +0 -25
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DoctorPatientController = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const repository_1 = require("@loopback/repository");
|
|
6
|
-
const rest_1 = require("@loopback/rest");
|
|
7
|
-
const models_1 = require("../models");
|
|
8
|
-
const repositories_1 = require("../repositories");
|
|
9
|
-
let DoctorPatientController = class DoctorPatientController {
|
|
10
|
-
constructor(doctorRepository) {
|
|
11
|
-
this.doctorRepository = doctorRepository;
|
|
12
|
-
}
|
|
13
|
-
async find(id, filter) {
|
|
14
|
-
return this.doctorRepository.patients(id).find(filter);
|
|
15
|
-
}
|
|
16
|
-
async create(id, patient) {
|
|
17
|
-
return this.doctorRepository.patients(id).create(patient);
|
|
18
|
-
}
|
|
19
|
-
async patch(id, patient, where) {
|
|
20
|
-
return this.doctorRepository.patients(id).patch(patient, where);
|
|
21
|
-
}
|
|
22
|
-
async delete(id, where) {
|
|
23
|
-
return this.doctorRepository.patients(id).delete(where);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
exports.DoctorPatientController = DoctorPatientController;
|
|
27
|
-
tslib_1.__decorate([
|
|
28
|
-
(0, rest_1.get)('/doctors/{id}/patients', {
|
|
29
|
-
responses: {
|
|
30
|
-
'200': {
|
|
31
|
-
description: 'Array of Doctor has many Patient through Appointment',
|
|
32
|
-
content: {
|
|
33
|
-
'application/json': {
|
|
34
|
-
schema: { type: 'array', items: (0, rest_1.getModelSchemaRef)(models_1.Patient) },
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
41
|
-
tslib_1.__param(1, rest_1.param.query.object('filter')),
|
|
42
|
-
tslib_1.__metadata("design:type", Function),
|
|
43
|
-
tslib_1.__metadata("design:paramtypes", [Number, Object]),
|
|
44
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
45
|
-
], DoctorPatientController.prototype, "find", null);
|
|
46
|
-
tslib_1.__decorate([
|
|
47
|
-
(0, rest_1.post)('/doctors/{id}/patients', {
|
|
48
|
-
responses: {
|
|
49
|
-
'200': {
|
|
50
|
-
description: 'create a Patient model instance',
|
|
51
|
-
content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.Patient) } },
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
}),
|
|
55
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
56
|
-
tslib_1.__param(1, (0, rest_1.requestBody)({
|
|
57
|
-
content: {
|
|
58
|
-
'application/json': {
|
|
59
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Patient, {
|
|
60
|
-
title: 'NewPatientInDoctor',
|
|
61
|
-
exclude: ['id'],
|
|
62
|
-
}),
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
})),
|
|
66
|
-
tslib_1.__metadata("design:type", Function),
|
|
67
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
68
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
69
|
-
], DoctorPatientController.prototype, "create", null);
|
|
70
|
-
tslib_1.__decorate([
|
|
71
|
-
(0, rest_1.patch)('/doctors/{id}/patients', {
|
|
72
|
-
responses: {
|
|
73
|
-
'200': {
|
|
74
|
-
description: 'Doctor.Patient PATCH success count',
|
|
75
|
-
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
}),
|
|
79
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
80
|
-
tslib_1.__param(1, (0, rest_1.requestBody)({
|
|
81
|
-
content: {
|
|
82
|
-
'application/json': {
|
|
83
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Patient, { partial: true }),
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
})),
|
|
87
|
-
tslib_1.__param(2, rest_1.param.query.object('where', (0, rest_1.getWhereSchemaFor)(models_1.Patient))),
|
|
88
|
-
tslib_1.__metadata("design:type", Function),
|
|
89
|
-
tslib_1.__metadata("design:paramtypes", [Number, Object, Object]),
|
|
90
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
91
|
-
], DoctorPatientController.prototype, "patch", null);
|
|
92
|
-
tslib_1.__decorate([
|
|
93
|
-
(0, rest_1.del)('/doctors/{id}/patients', {
|
|
94
|
-
responses: {
|
|
95
|
-
'200': {
|
|
96
|
-
description: 'Doctor.Patient DELETE success count',
|
|
97
|
-
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
102
|
-
tslib_1.__param(1, rest_1.param.query.object('where', (0, rest_1.getWhereSchemaFor)(models_1.Patient))),
|
|
103
|
-
tslib_1.__metadata("design:type", Function),
|
|
104
|
-
tslib_1.__metadata("design:paramtypes", [Number, Object]),
|
|
105
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
106
|
-
], DoctorPatientController.prototype, "delete", null);
|
|
107
|
-
exports.DoctorPatientController = DoctorPatientController = tslib_1.__decorate([
|
|
108
|
-
tslib_1.__param(0, (0, repository_1.repository)(repositories_1.DoctorRepository)),
|
|
109
|
-
tslib_1.__metadata("design:paramtypes", [repositories_1.DoctorRepository])
|
|
110
|
-
], DoctorPatientController);
|
|
111
|
-
//# sourceMappingURL=doctor-patient.controller.js.map
|
|
112
|
-
//# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/doctor-patient.controller.js.map
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DoctorController = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const repository_1 = require("@loopback/repository");
|
|
6
|
-
const rest_1 = require("@loopback/rest");
|
|
7
|
-
const models_1 = require("../models");
|
|
8
|
-
const repositories_1 = require("../repositories");
|
|
9
|
-
const test_controller_base_1 = require("./test.controller.base");
|
|
10
|
-
let DoctorController = class DoctorController extends test_controller_base_1.TestControllerBase {
|
|
11
|
-
constructor(doctorRepository) {
|
|
12
|
-
super(doctorRepository);
|
|
13
|
-
this.doctorRepository = doctorRepository;
|
|
14
|
-
}
|
|
15
|
-
async create(doctor) {
|
|
16
|
-
return this.doctorRepository.create(doctor);
|
|
17
|
-
}
|
|
18
|
-
async count(where) {
|
|
19
|
-
return this.doctorRepository.count(where);
|
|
20
|
-
}
|
|
21
|
-
async find(filter) {
|
|
22
|
-
return this.doctorRepository.find(filter);
|
|
23
|
-
}
|
|
24
|
-
async updateAll(doctor, where) {
|
|
25
|
-
return this.doctorRepository.updateAll(doctor, where);
|
|
26
|
-
}
|
|
27
|
-
async findById(id, filter) {
|
|
28
|
-
return this.doctorRepository.findById(id, filter);
|
|
29
|
-
}
|
|
30
|
-
async updateById(id, doctor) {
|
|
31
|
-
await this.doctorRepository.updateById(id, doctor);
|
|
32
|
-
}
|
|
33
|
-
async replaceById(id, doctor) {
|
|
34
|
-
await this.doctorRepository.replaceById(id, doctor);
|
|
35
|
-
}
|
|
36
|
-
async deleteById(id) {
|
|
37
|
-
await this.doctorRepository.deleteById(id);
|
|
38
|
-
}
|
|
39
|
-
async syncSequelizeModel() {
|
|
40
|
-
await this.beforeEach({ syncAll: true });
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.DoctorController = DoctorController;
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, rest_1.post)('/doctors'),
|
|
46
|
-
(0, rest_1.response)(200, {
|
|
47
|
-
description: 'Doctor model instance',
|
|
48
|
-
content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.Doctor) } },
|
|
49
|
-
}),
|
|
50
|
-
tslib_1.__param(0, (0, rest_1.requestBody)({
|
|
51
|
-
content: {
|
|
52
|
-
'application/json': {
|
|
53
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Doctor, {
|
|
54
|
-
title: 'NewDoctor',
|
|
55
|
-
exclude: ['id'],
|
|
56
|
-
}),
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
})),
|
|
60
|
-
tslib_1.__metadata("design:type", Function),
|
|
61
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
62
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
63
|
-
], DoctorController.prototype, "create", null);
|
|
64
|
-
tslib_1.__decorate([
|
|
65
|
-
(0, rest_1.get)('/doctors/count'),
|
|
66
|
-
(0, rest_1.response)(200, {
|
|
67
|
-
description: 'Doctor model count',
|
|
68
|
-
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
69
|
-
}),
|
|
70
|
-
tslib_1.__param(0, rest_1.param.where(models_1.Doctor)),
|
|
71
|
-
tslib_1.__metadata("design:type", Function),
|
|
72
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
73
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
74
|
-
], DoctorController.prototype, "count", null);
|
|
75
|
-
tslib_1.__decorate([
|
|
76
|
-
(0, rest_1.get)('/doctors'),
|
|
77
|
-
(0, rest_1.response)(200, {
|
|
78
|
-
description: 'Array of Doctor model instances',
|
|
79
|
-
content: {
|
|
80
|
-
'application/json': {
|
|
81
|
-
schema: {
|
|
82
|
-
type: 'array',
|
|
83
|
-
items: (0, rest_1.getModelSchemaRef)(models_1.Doctor, { includeRelations: true }),
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
}),
|
|
88
|
-
tslib_1.__param(0, rest_1.param.filter(models_1.Doctor)),
|
|
89
|
-
tslib_1.__metadata("design:type", Function),
|
|
90
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
91
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
92
|
-
], DoctorController.prototype, "find", null);
|
|
93
|
-
tslib_1.__decorate([
|
|
94
|
-
(0, rest_1.patch)('/doctors'),
|
|
95
|
-
(0, rest_1.response)(200, {
|
|
96
|
-
description: 'Doctor PATCH success count',
|
|
97
|
-
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
98
|
-
}),
|
|
99
|
-
tslib_1.__param(0, (0, rest_1.requestBody)({
|
|
100
|
-
content: {
|
|
101
|
-
'application/json': {
|
|
102
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Doctor, { partial: true }),
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
})),
|
|
106
|
-
tslib_1.__param(1, rest_1.param.where(models_1.Doctor)),
|
|
107
|
-
tslib_1.__metadata("design:type", Function),
|
|
108
|
-
tslib_1.__metadata("design:paramtypes", [models_1.Doctor, Object]),
|
|
109
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
110
|
-
], DoctorController.prototype, "updateAll", null);
|
|
111
|
-
tslib_1.__decorate([
|
|
112
|
-
(0, rest_1.get)('/doctors/{id}'),
|
|
113
|
-
(0, rest_1.response)(200, {
|
|
114
|
-
description: 'Doctor model instance',
|
|
115
|
-
content: {
|
|
116
|
-
'application/json': {
|
|
117
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Doctor, { includeRelations: true }),
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
}),
|
|
121
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
122
|
-
tslib_1.__param(1, rest_1.param.filter(models_1.Doctor, { exclude: 'where' })),
|
|
123
|
-
tslib_1.__metadata("design:type", Function),
|
|
124
|
-
tslib_1.__metadata("design:paramtypes", [Number, Object]),
|
|
125
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
126
|
-
], DoctorController.prototype, "findById", null);
|
|
127
|
-
tslib_1.__decorate([
|
|
128
|
-
(0, rest_1.patch)('/doctors/{id}'),
|
|
129
|
-
(0, rest_1.response)(204, {
|
|
130
|
-
description: 'Doctor PATCH success',
|
|
131
|
-
}),
|
|
132
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
133
|
-
tslib_1.__param(1, (0, rest_1.requestBody)({
|
|
134
|
-
content: {
|
|
135
|
-
'application/json': {
|
|
136
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Doctor, { partial: true }),
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
})),
|
|
140
|
-
tslib_1.__metadata("design:type", Function),
|
|
141
|
-
tslib_1.__metadata("design:paramtypes", [Number, models_1.Doctor]),
|
|
142
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
143
|
-
], DoctorController.prototype, "updateById", null);
|
|
144
|
-
tslib_1.__decorate([
|
|
145
|
-
(0, rest_1.put)('/doctors/{id}'),
|
|
146
|
-
(0, rest_1.response)(204, {
|
|
147
|
-
description: 'Doctor PUT success',
|
|
148
|
-
}),
|
|
149
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
150
|
-
tslib_1.__param(1, (0, rest_1.requestBody)()),
|
|
151
|
-
tslib_1.__metadata("design:type", Function),
|
|
152
|
-
tslib_1.__metadata("design:paramtypes", [Number, models_1.Doctor]),
|
|
153
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
154
|
-
], DoctorController.prototype, "replaceById", null);
|
|
155
|
-
tslib_1.__decorate([
|
|
156
|
-
(0, rest_1.del)('/doctors/{id}'),
|
|
157
|
-
(0, rest_1.response)(204, {
|
|
158
|
-
description: 'Doctor DELETE success',
|
|
159
|
-
}),
|
|
160
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
161
|
-
tslib_1.__metadata("design:type", Function),
|
|
162
|
-
tslib_1.__metadata("design:paramtypes", [Number]),
|
|
163
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
164
|
-
], DoctorController.prototype, "deleteById", null);
|
|
165
|
-
tslib_1.__decorate([
|
|
166
|
-
(0, rest_1.get)('/doctors/sync-sequelize-model'),
|
|
167
|
-
(0, rest_1.response)(200),
|
|
168
|
-
tslib_1.__metadata("design:type", Function),
|
|
169
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
170
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
171
|
-
], DoctorController.prototype, "syncSequelizeModel", null);
|
|
172
|
-
exports.DoctorController = DoctorController = tslib_1.__decorate([
|
|
173
|
-
tslib_1.__param(0, (0, repository_1.repository)(repositories_1.DoctorRepository)),
|
|
174
|
-
tslib_1.__metadata("design:paramtypes", [repositories_1.DoctorRepository])
|
|
175
|
-
], DoctorController);
|
|
176
|
-
//# sourceMappingURL=doctor.controller.js.map
|
|
177
|
-
//# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/doctor.controller.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./book-category.controller"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./book.controller"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./category.controller"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./developer.controller"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./doctor-patient.controller"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./doctor.controller"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./patient.controller"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./product.controller"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./programming-languange.controller"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./task.controller"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./test.controller.base"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./todo-list-todo.controller"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./todo-list.controller"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./todo-todo-list.controller"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./todo.controller"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./transaction.controller"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./user-todo-list.controller"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./user.controller"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
23
|
-
//# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/index.js.map
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PatientController = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const repository_1 = require("@loopback/repository");
|
|
6
|
-
const rest_1 = require("@loopback/rest");
|
|
7
|
-
const models_1 = require("../models");
|
|
8
|
-
const repositories_1 = require("../repositories");
|
|
9
|
-
let PatientController = class PatientController {
|
|
10
|
-
constructor(patientRepository) {
|
|
11
|
-
this.patientRepository = patientRepository;
|
|
12
|
-
}
|
|
13
|
-
async create(patient) {
|
|
14
|
-
return this.patientRepository.create(patient);
|
|
15
|
-
}
|
|
16
|
-
async count(where) {
|
|
17
|
-
return this.patientRepository.count(where);
|
|
18
|
-
}
|
|
19
|
-
async find(filter) {
|
|
20
|
-
return this.patientRepository.find(filter);
|
|
21
|
-
}
|
|
22
|
-
async updateAll(patient, where) {
|
|
23
|
-
return this.patientRepository.updateAll(patient, where);
|
|
24
|
-
}
|
|
25
|
-
async findById(id, filter) {
|
|
26
|
-
return this.patientRepository.findById(id, filter);
|
|
27
|
-
}
|
|
28
|
-
async updateById(id, patient) {
|
|
29
|
-
await this.patientRepository.updateById(id, patient);
|
|
30
|
-
}
|
|
31
|
-
async replaceById(id, patient) {
|
|
32
|
-
await this.patientRepository.replaceById(id, patient);
|
|
33
|
-
}
|
|
34
|
-
async deleteById(id) {
|
|
35
|
-
await this.patientRepository.deleteById(id);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.PatientController = PatientController;
|
|
39
|
-
tslib_1.__decorate([
|
|
40
|
-
(0, rest_1.post)('/patients'),
|
|
41
|
-
(0, rest_1.response)(200, {
|
|
42
|
-
description: 'Patient model instance',
|
|
43
|
-
content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.Patient) } },
|
|
44
|
-
}),
|
|
45
|
-
tslib_1.__param(0, (0, rest_1.requestBody)({
|
|
46
|
-
content: {
|
|
47
|
-
'application/json': {
|
|
48
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Patient, {
|
|
49
|
-
title: 'NewPatient',
|
|
50
|
-
exclude: ['id'],
|
|
51
|
-
}),
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
})),
|
|
55
|
-
tslib_1.__metadata("design:type", Function),
|
|
56
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
57
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
58
|
-
], PatientController.prototype, "create", null);
|
|
59
|
-
tslib_1.__decorate([
|
|
60
|
-
(0, rest_1.get)('/patients/count'),
|
|
61
|
-
(0, rest_1.response)(200, {
|
|
62
|
-
description: 'Patient model count',
|
|
63
|
-
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
64
|
-
}),
|
|
65
|
-
tslib_1.__param(0, rest_1.param.where(models_1.Patient)),
|
|
66
|
-
tslib_1.__metadata("design:type", Function),
|
|
67
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
68
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
69
|
-
], PatientController.prototype, "count", null);
|
|
70
|
-
tslib_1.__decorate([
|
|
71
|
-
(0, rest_1.get)('/patients'),
|
|
72
|
-
(0, rest_1.response)(200, {
|
|
73
|
-
description: 'Array of Patient model instances',
|
|
74
|
-
content: {
|
|
75
|
-
'application/json': {
|
|
76
|
-
schema: {
|
|
77
|
-
type: 'array',
|
|
78
|
-
items: (0, rest_1.getModelSchemaRef)(models_1.Patient, { includeRelations: true }),
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
tslib_1.__param(0, rest_1.param.filter(models_1.Patient)),
|
|
84
|
-
tslib_1.__metadata("design:type", Function),
|
|
85
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
86
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
87
|
-
], PatientController.prototype, "find", null);
|
|
88
|
-
tslib_1.__decorate([
|
|
89
|
-
(0, rest_1.patch)('/patients'),
|
|
90
|
-
(0, rest_1.response)(200, {
|
|
91
|
-
description: 'Patient PATCH success count',
|
|
92
|
-
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
93
|
-
}),
|
|
94
|
-
tslib_1.__param(0, (0, rest_1.requestBody)({
|
|
95
|
-
content: {
|
|
96
|
-
'application/json': {
|
|
97
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Patient, { partial: true }),
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
})),
|
|
101
|
-
tslib_1.__param(1, rest_1.param.where(models_1.Patient)),
|
|
102
|
-
tslib_1.__metadata("design:type", Function),
|
|
103
|
-
tslib_1.__metadata("design:paramtypes", [models_1.Patient, Object]),
|
|
104
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
105
|
-
], PatientController.prototype, "updateAll", null);
|
|
106
|
-
tslib_1.__decorate([
|
|
107
|
-
(0, rest_1.get)('/patients/{id}'),
|
|
108
|
-
(0, rest_1.response)(200, {
|
|
109
|
-
description: 'Patient model instance',
|
|
110
|
-
content: {
|
|
111
|
-
'application/json': {
|
|
112
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Patient, { includeRelations: true }),
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
}),
|
|
116
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
117
|
-
tslib_1.__param(1, rest_1.param.filter(models_1.Patient, { exclude: 'where' })),
|
|
118
|
-
tslib_1.__metadata("design:type", Function),
|
|
119
|
-
tslib_1.__metadata("design:paramtypes", [Number, Object]),
|
|
120
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
121
|
-
], PatientController.prototype, "findById", null);
|
|
122
|
-
tslib_1.__decorate([
|
|
123
|
-
(0, rest_1.patch)('/patients/{id}'),
|
|
124
|
-
(0, rest_1.response)(204, {
|
|
125
|
-
description: 'Patient PATCH success',
|
|
126
|
-
}),
|
|
127
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
128
|
-
tslib_1.__param(1, (0, rest_1.requestBody)({
|
|
129
|
-
content: {
|
|
130
|
-
'application/json': {
|
|
131
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Patient, { partial: true }),
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
})),
|
|
135
|
-
tslib_1.__metadata("design:type", Function),
|
|
136
|
-
tslib_1.__metadata("design:paramtypes", [Number, models_1.Patient]),
|
|
137
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
138
|
-
], PatientController.prototype, "updateById", null);
|
|
139
|
-
tslib_1.__decorate([
|
|
140
|
-
(0, rest_1.put)('/patients/{id}'),
|
|
141
|
-
(0, rest_1.response)(204, {
|
|
142
|
-
description: 'Patient PUT success',
|
|
143
|
-
}),
|
|
144
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
145
|
-
tslib_1.__param(1, (0, rest_1.requestBody)()),
|
|
146
|
-
tslib_1.__metadata("design:type", Function),
|
|
147
|
-
tslib_1.__metadata("design:paramtypes", [Number, models_1.Patient]),
|
|
148
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
149
|
-
], PatientController.prototype, "replaceById", null);
|
|
150
|
-
tslib_1.__decorate([
|
|
151
|
-
(0, rest_1.del)('/patients/{id}'),
|
|
152
|
-
(0, rest_1.response)(204, {
|
|
153
|
-
description: 'Patient DELETE success',
|
|
154
|
-
}),
|
|
155
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
156
|
-
tslib_1.__metadata("design:type", Function),
|
|
157
|
-
tslib_1.__metadata("design:paramtypes", [Number]),
|
|
158
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
159
|
-
], PatientController.prototype, "deleteById", null);
|
|
160
|
-
exports.PatientController = PatientController = tslib_1.__decorate([
|
|
161
|
-
tslib_1.__param(0, (0, repository_1.repository)(repositories_1.PatientRepository)),
|
|
162
|
-
tslib_1.__metadata("design:paramtypes", [repositories_1.PatientRepository])
|
|
163
|
-
], PatientController);
|
|
164
|
-
//# sourceMappingURL=patient.controller.js.map
|
|
165
|
-
//# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/patient.controller.js.map
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductController = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const repository_1 = require("@loopback/repository");
|
|
6
|
-
const rest_1 = require("@loopback/rest");
|
|
7
|
-
const models_1 = require("../models");
|
|
8
|
-
const repositories_1 = require("../repositories");
|
|
9
|
-
const test_controller_base_1 = require("./test.controller.base");
|
|
10
|
-
let ProductController = class ProductController extends test_controller_base_1.TestControllerBase {
|
|
11
|
-
constructor(productRepository) {
|
|
12
|
-
super(productRepository);
|
|
13
|
-
this.productRepository = productRepository;
|
|
14
|
-
}
|
|
15
|
-
async create(product) {
|
|
16
|
-
return this.productRepository.create(product);
|
|
17
|
-
}
|
|
18
|
-
async count(where) {
|
|
19
|
-
return this.productRepository.count(where);
|
|
20
|
-
}
|
|
21
|
-
async find(filter) {
|
|
22
|
-
return this.productRepository.find(filter);
|
|
23
|
-
}
|
|
24
|
-
async updateAll(product, where) {
|
|
25
|
-
return this.productRepository.updateAll(product, where);
|
|
26
|
-
}
|
|
27
|
-
async findById(id, filter) {
|
|
28
|
-
return this.productRepository.findById(id, filter);
|
|
29
|
-
}
|
|
30
|
-
async updateById(id, product) {
|
|
31
|
-
await this.productRepository.updateById(id, product);
|
|
32
|
-
}
|
|
33
|
-
async replaceById(id, product) {
|
|
34
|
-
await this.productRepository.replaceById(id, product);
|
|
35
|
-
}
|
|
36
|
-
async deleteById(id) {
|
|
37
|
-
await this.productRepository.deleteById(id);
|
|
38
|
-
}
|
|
39
|
-
async syncSequelizeModel() {
|
|
40
|
-
await this.beforeEach();
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.ProductController = ProductController;
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, rest_1.post)('/products'),
|
|
46
|
-
(0, rest_1.response)(200, {
|
|
47
|
-
description: 'Product model instance',
|
|
48
|
-
content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.Product) } },
|
|
49
|
-
}),
|
|
50
|
-
tslib_1.__param(0, (0, rest_1.requestBody)({
|
|
51
|
-
content: {
|
|
52
|
-
'application/json': {
|
|
53
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Product, {
|
|
54
|
-
title: 'NewProduct',
|
|
55
|
-
exclude: ['id'],
|
|
56
|
-
}),
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
})),
|
|
60
|
-
tslib_1.__metadata("design:type", Function),
|
|
61
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
62
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
63
|
-
], ProductController.prototype, "create", null);
|
|
64
|
-
tslib_1.__decorate([
|
|
65
|
-
(0, rest_1.get)('/products/count'),
|
|
66
|
-
(0, rest_1.response)(200, {
|
|
67
|
-
description: 'Product model count',
|
|
68
|
-
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
69
|
-
}),
|
|
70
|
-
tslib_1.__param(0, rest_1.param.where(models_1.Product)),
|
|
71
|
-
tslib_1.__metadata("design:type", Function),
|
|
72
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
73
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
74
|
-
], ProductController.prototype, "count", null);
|
|
75
|
-
tslib_1.__decorate([
|
|
76
|
-
(0, rest_1.get)('/products'),
|
|
77
|
-
(0, rest_1.response)(200, {
|
|
78
|
-
description: 'Array of Product model instances',
|
|
79
|
-
content: {
|
|
80
|
-
'application/json': {
|
|
81
|
-
schema: {
|
|
82
|
-
type: 'array',
|
|
83
|
-
items: (0, rest_1.getModelSchemaRef)(models_1.Product, { includeRelations: true }),
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
}),
|
|
88
|
-
tslib_1.__param(0, rest_1.param.filter(models_1.Product)),
|
|
89
|
-
tslib_1.__metadata("design:type", Function),
|
|
90
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
91
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
92
|
-
], ProductController.prototype, "find", null);
|
|
93
|
-
tslib_1.__decorate([
|
|
94
|
-
(0, rest_1.patch)('/products'),
|
|
95
|
-
(0, rest_1.response)(200, {
|
|
96
|
-
description: 'Product PATCH success count',
|
|
97
|
-
content: { 'application/json': { schema: repository_1.CountSchema } },
|
|
98
|
-
}),
|
|
99
|
-
tslib_1.__param(0, (0, rest_1.requestBody)({
|
|
100
|
-
content: {
|
|
101
|
-
'application/json': {
|
|
102
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Product, { partial: true }),
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
})),
|
|
106
|
-
tslib_1.__param(1, rest_1.param.where(models_1.Product)),
|
|
107
|
-
tslib_1.__metadata("design:type", Function),
|
|
108
|
-
tslib_1.__metadata("design:paramtypes", [models_1.Product, Object]),
|
|
109
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
110
|
-
], ProductController.prototype, "updateAll", null);
|
|
111
|
-
tslib_1.__decorate([
|
|
112
|
-
(0, rest_1.get)('/products/{id}'),
|
|
113
|
-
(0, rest_1.response)(200, {
|
|
114
|
-
description: 'Product model instance',
|
|
115
|
-
content: {
|
|
116
|
-
'application/json': {
|
|
117
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Product, { includeRelations: true }),
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
}),
|
|
121
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
122
|
-
tslib_1.__param(1, rest_1.param.filter(models_1.Product, { exclude: 'where' })),
|
|
123
|
-
tslib_1.__metadata("design:type", Function),
|
|
124
|
-
tslib_1.__metadata("design:paramtypes", [Number, Object]),
|
|
125
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
126
|
-
], ProductController.prototype, "findById", null);
|
|
127
|
-
tslib_1.__decorate([
|
|
128
|
-
(0, rest_1.patch)('/products/{id}'),
|
|
129
|
-
(0, rest_1.response)(204, {
|
|
130
|
-
description: 'Product PATCH success',
|
|
131
|
-
}),
|
|
132
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
133
|
-
tslib_1.__param(1, (0, rest_1.requestBody)({
|
|
134
|
-
content: {
|
|
135
|
-
'application/json': {
|
|
136
|
-
schema: (0, rest_1.getModelSchemaRef)(models_1.Product, { partial: true }),
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
})),
|
|
140
|
-
tslib_1.__metadata("design:type", Function),
|
|
141
|
-
tslib_1.__metadata("design:paramtypes", [Number, models_1.Product]),
|
|
142
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
143
|
-
], ProductController.prototype, "updateById", null);
|
|
144
|
-
tslib_1.__decorate([
|
|
145
|
-
(0, rest_1.put)('/products/{id}'),
|
|
146
|
-
(0, rest_1.response)(204, {
|
|
147
|
-
description: 'Product PUT success',
|
|
148
|
-
}),
|
|
149
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
150
|
-
tslib_1.__param(1, (0, rest_1.requestBody)()),
|
|
151
|
-
tslib_1.__metadata("design:type", Function),
|
|
152
|
-
tslib_1.__metadata("design:paramtypes", [Number, models_1.Product]),
|
|
153
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
154
|
-
], ProductController.prototype, "replaceById", null);
|
|
155
|
-
tslib_1.__decorate([
|
|
156
|
-
(0, rest_1.del)('/products/{id}'),
|
|
157
|
-
(0, rest_1.response)(204, {
|
|
158
|
-
description: 'Product DELETE success',
|
|
159
|
-
}),
|
|
160
|
-
tslib_1.__param(0, rest_1.param.path.number('id')),
|
|
161
|
-
tslib_1.__metadata("design:type", Function),
|
|
162
|
-
tslib_1.__metadata("design:paramtypes", [Number]),
|
|
163
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
164
|
-
], ProductController.prototype, "deleteById", null);
|
|
165
|
-
tslib_1.__decorate([
|
|
166
|
-
(0, rest_1.get)('/products/sync-sequelize-model'),
|
|
167
|
-
(0, rest_1.response)(200),
|
|
168
|
-
tslib_1.__metadata("design:type", Function),
|
|
169
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
170
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
171
|
-
], ProductController.prototype, "syncSequelizeModel", null);
|
|
172
|
-
exports.ProductController = ProductController = tslib_1.__decorate([
|
|
173
|
-
tslib_1.__param(0, (0, repository_1.repository)(repositories_1.ProductRepository)),
|
|
174
|
-
tslib_1.__metadata("design:paramtypes", [repositories_1.ProductRepository])
|
|
175
|
-
], ProductController);
|
|
176
|
-
//# sourceMappingURL=product.controller.js.map
|
|
177
|
-
//# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/product.controller.js.map
|