@loopback/sequelize 0.5.2 → 0.5.3

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