@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,210 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TaskController = 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 TaskController = class TaskController extends test_controller_base_1.TestControllerBase {
11
- constructor(taskRepository) {
12
- super(taskRepository);
13
- this.taskRepository = taskRepository;
14
- }
15
- async create(task) {
16
- return this.taskRepository.create(task);
17
- }
18
- async createAll(tasks) {
19
- return this.taskRepository.createAll(tasks);
20
- }
21
- async count(where) {
22
- return this.taskRepository.count(where);
23
- }
24
- async find(filter) {
25
- return this.taskRepository.find(filter);
26
- }
27
- async updateAll(task, where) {
28
- return this.taskRepository.updateAll(task, where);
29
- }
30
- async findById(id, filter) {
31
- return this.taskRepository.findById(id, filter);
32
- }
33
- async updateById(id, task) {
34
- await this.taskRepository.updateById(id, task);
35
- }
36
- async replaceById(id, task) {
37
- await this.taskRepository.replaceById(id, task);
38
- }
39
- async deleteById(id) {
40
- await this.taskRepository.deleteById(id);
41
- }
42
- async syncSequelizeModel() {
43
- await this.beforeEach();
44
- }
45
- };
46
- exports.TaskController = TaskController;
47
- tslib_1.__decorate([
48
- (0, rest_1.post)('/tasks'),
49
- (0, rest_1.response)(200, {
50
- description: 'task model instance',
51
- content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.Task) } },
52
- }),
53
- tslib_1.__param(0, (0, rest_1.requestBody)({
54
- content: {
55
- 'application/json': {
56
- schema: (0, rest_1.getModelSchemaRef)(models_1.Task, {
57
- title: 'NewTask',
58
- exclude: ['id'],
59
- }),
60
- },
61
- },
62
- })),
63
- tslib_1.__metadata("design:type", Function),
64
- tslib_1.__metadata("design:paramtypes", [Object]),
65
- tslib_1.__metadata("design:returntype", Promise)
66
- ], TaskController.prototype, "create", null);
67
- tslib_1.__decorate([
68
- (0, rest_1.post)('/tasks-bulk'),
69
- (0, rest_1.response)(200, {
70
- description: 'task model instances',
71
- content: {
72
- 'application/json': {
73
- schema: {
74
- type: 'array',
75
- items: (0, rest_1.getModelSchemaRef)(models_1.Task),
76
- },
77
- },
78
- },
79
- }),
80
- tslib_1.__param(0, (0, rest_1.requestBody)({
81
- content: {
82
- 'application/json': {
83
- schema: {
84
- type: 'array',
85
- items: (0, rest_1.getModelSchemaRef)(models_1.Task, {
86
- title: 'NewTask',
87
- exclude: ['id'],
88
- }),
89
- },
90
- },
91
- },
92
- })),
93
- tslib_1.__metadata("design:type", Function),
94
- tslib_1.__metadata("design:paramtypes", [Array]),
95
- tslib_1.__metadata("design:returntype", Promise)
96
- ], TaskController.prototype, "createAll", null);
97
- tslib_1.__decorate([
98
- (0, rest_1.get)('/tasks/count'),
99
- (0, rest_1.response)(200, {
100
- description: 'Task model count',
101
- content: { 'application/json': { schema: repository_1.CountSchema } },
102
- }),
103
- tslib_1.__param(0, rest_1.param.where(models_1.Task)),
104
- tslib_1.__metadata("design:type", Function),
105
- tslib_1.__metadata("design:paramtypes", [Object]),
106
- tslib_1.__metadata("design:returntype", Promise)
107
- ], TaskController.prototype, "count", null);
108
- tslib_1.__decorate([
109
- (0, rest_1.get)('/tasks'),
110
- (0, rest_1.response)(200, {
111
- description: 'Array of Task model instances',
112
- content: {
113
- 'application/json': {
114
- schema: {
115
- type: 'array',
116
- items: (0, rest_1.getModelSchemaRef)(models_1.Task, { includeRelations: true }),
117
- },
118
- },
119
- },
120
- }),
121
- tslib_1.__param(0, rest_1.param.filter(models_1.Task)),
122
- tslib_1.__metadata("design:type", Function),
123
- tslib_1.__metadata("design:paramtypes", [Object]),
124
- tslib_1.__metadata("design:returntype", Promise)
125
- ], TaskController.prototype, "find", null);
126
- tslib_1.__decorate([
127
- (0, rest_1.patch)('/tasks'),
128
- (0, rest_1.response)(200, {
129
- description: 'Task PATCH success count',
130
- content: { 'application/json': { schema: repository_1.CountSchema } },
131
- }),
132
- tslib_1.__param(0, (0, rest_1.requestBody)({
133
- content: {
134
- 'application/json': {
135
- schema: (0, rest_1.getModelSchemaRef)(models_1.Task, { partial: true }),
136
- },
137
- },
138
- })),
139
- tslib_1.__param(1, rest_1.param.where(models_1.Task)),
140
- tslib_1.__metadata("design:type", Function),
141
- tslib_1.__metadata("design:paramtypes", [models_1.Task, Object]),
142
- tslib_1.__metadata("design:returntype", Promise)
143
- ], TaskController.prototype, "updateAll", null);
144
- tslib_1.__decorate([
145
- (0, rest_1.get)('/tasks/{id}'),
146
- (0, rest_1.response)(200, {
147
- description: 'Task model instance',
148
- content: {
149
- 'application/json': {
150
- schema: (0, rest_1.getModelSchemaRef)(models_1.Task, { includeRelations: true }),
151
- },
152
- },
153
- }),
154
- tslib_1.__param(0, rest_1.param.path.number('id')),
155
- tslib_1.__param(1, rest_1.param.filter(models_1.Task, { exclude: 'where' })),
156
- tslib_1.__metadata("design:type", Function),
157
- tslib_1.__metadata("design:paramtypes", [Number, Object]),
158
- tslib_1.__metadata("design:returntype", Promise)
159
- ], TaskController.prototype, "findById", null);
160
- tslib_1.__decorate([
161
- (0, rest_1.patch)('/tasks/{id}'),
162
- (0, rest_1.response)(204, {
163
- description: 'Task PATCH success',
164
- }),
165
- tslib_1.__param(0, rest_1.param.path.number('id')),
166
- tslib_1.__param(1, (0, rest_1.requestBody)({
167
- content: {
168
- 'application/json': {
169
- schema: (0, rest_1.getModelSchemaRef)(models_1.Task, { partial: true }),
170
- },
171
- },
172
- })),
173
- tslib_1.__metadata("design:type", Function),
174
- tslib_1.__metadata("design:paramtypes", [Number, models_1.Task]),
175
- tslib_1.__metadata("design:returntype", Promise)
176
- ], TaskController.prototype, "updateById", null);
177
- tslib_1.__decorate([
178
- (0, rest_1.put)('/tasks/{id}'),
179
- (0, rest_1.response)(204, {
180
- description: 'Task PUT success',
181
- }),
182
- tslib_1.__param(0, rest_1.param.path.number('id')),
183
- tslib_1.__param(1, (0, rest_1.requestBody)()),
184
- tslib_1.__metadata("design:type", Function),
185
- tslib_1.__metadata("design:paramtypes", [Number, models_1.Task]),
186
- tslib_1.__metadata("design:returntype", Promise)
187
- ], TaskController.prototype, "replaceById", null);
188
- tslib_1.__decorate([
189
- (0, rest_1.del)('/tasks/{id}'),
190
- (0, rest_1.response)(204, {
191
- description: 'Task DELETE success',
192
- }),
193
- tslib_1.__param(0, rest_1.param.path.number('id')),
194
- tslib_1.__metadata("design:type", Function),
195
- tslib_1.__metadata("design:paramtypes", [Number]),
196
- tslib_1.__metadata("design:returntype", Promise)
197
- ], TaskController.prototype, "deleteById", null);
198
- tslib_1.__decorate([
199
- (0, rest_1.get)('/tasks/sync-sequelize-model'),
200
- (0, rest_1.response)(200),
201
- tslib_1.__metadata("design:type", Function),
202
- tslib_1.__metadata("design:paramtypes", []),
203
- tslib_1.__metadata("design:returntype", Promise)
204
- ], TaskController.prototype, "syncSequelizeModel", null);
205
- exports.TaskController = TaskController = tslib_1.__decorate([
206
- tslib_1.__param(0, (0, repository_1.repository)(repositories_1.TaskRepository)),
207
- tslib_1.__metadata("design:paramtypes", [repositories_1.TaskRepository])
208
- ], TaskController);
209
- //# sourceMappingURL=task.controller.js.map
210
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/task.controller.js.map
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TestControllerBase = void 0;
4
- class TestControllerBase {
5
- constructor(...repositories) {
6
- this.repositories = repositories;
7
- }
8
- /**
9
- * `beforeEach` is only for testing purposes in the controller,
10
- * Calling `syncSequelizeModel` ensures that corresponding table
11
- * exists before calling the function. In real project you are supposed
12
- * to run migrations instead, to sync model definitions to the target database.
13
- */
14
- async beforeEach(options = {}) {
15
- const syncOptions = { force: true };
16
- for (const repository of this.repositories) {
17
- if (options.syncAll) {
18
- await repository.syncLoadedSequelizeModels(syncOptions);
19
- continue;
20
- }
21
- await repository.syncSequelizeModel(syncOptions);
22
- }
23
- }
24
- }
25
- exports.TestControllerBase = TestControllerBase;
26
- //# sourceMappingURL=test.controller.base.js.map
27
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/test.controller.base.js.map
@@ -1,113 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TodoListTodoController = 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 TodoListTodoController = class TodoListTodoController {
10
- constructor(todoListRepository) {
11
- this.todoListRepository = todoListRepository;
12
- }
13
- async find(id, filter) {
14
- return this.todoListRepository.todos(id).find(filter);
15
- }
16
- async create(id, todo) {
17
- return this.todoListRepository.todos(id).create(todo);
18
- }
19
- async patch(id, todo, where) {
20
- return this.todoListRepository.todos(id).patch(todo, where);
21
- }
22
- async delete(id, where) {
23
- return this.todoListRepository.todos(id).delete(where);
24
- }
25
- };
26
- exports.TodoListTodoController = TodoListTodoController;
27
- tslib_1.__decorate([
28
- (0, rest_1.get)('/todo-lists/{id}/todos', {
29
- responses: {
30
- '200': {
31
- description: 'Array of TodoList has many Todo',
32
- content: {
33
- 'application/json': {
34
- schema: { type: 'array', items: (0, rest_1.getModelSchemaRef)(models_1.Todo) },
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
- ], TodoListTodoController.prototype, "find", null);
46
- tslib_1.__decorate([
47
- (0, rest_1.post)('/todo-lists/{id}/todos', {
48
- responses: {
49
- '200': {
50
- description: 'TodoList model instance',
51
- content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.Todo) } },
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.Todo, {
60
- title: 'NewTodoInTodoList',
61
- exclude: ['id'],
62
- optional: ['todoListId'],
63
- }),
64
- },
65
- },
66
- })),
67
- tslib_1.__metadata("design:type", Function),
68
- tslib_1.__metadata("design:paramtypes", [Object, Object]),
69
- tslib_1.__metadata("design:returntype", Promise)
70
- ], TodoListTodoController.prototype, "create", null);
71
- tslib_1.__decorate([
72
- (0, rest_1.patch)('/todo-lists/{id}/todos', {
73
- responses: {
74
- '200': {
75
- description: 'TodoList.Todo PATCH success count',
76
- content: { 'application/json': { schema: repository_1.CountSchema } },
77
- },
78
- },
79
- }),
80
- tslib_1.__param(0, rest_1.param.path.number('id')),
81
- tslib_1.__param(1, (0, rest_1.requestBody)({
82
- content: {
83
- 'application/json': {
84
- schema: (0, rest_1.getModelSchemaRef)(models_1.Todo, { partial: true }),
85
- },
86
- },
87
- })),
88
- tslib_1.__param(2, rest_1.param.query.object('where', (0, rest_1.getWhereSchemaFor)(models_1.Todo))),
89
- tslib_1.__metadata("design:type", Function),
90
- tslib_1.__metadata("design:paramtypes", [Number, Object, Object]),
91
- tslib_1.__metadata("design:returntype", Promise)
92
- ], TodoListTodoController.prototype, "patch", null);
93
- tslib_1.__decorate([
94
- (0, rest_1.del)('/todo-lists/{id}/todos', {
95
- responses: {
96
- '200': {
97
- description: 'TodoList.Todo DELETE success count',
98
- content: { 'application/json': { schema: repository_1.CountSchema } },
99
- },
100
- },
101
- }),
102
- tslib_1.__param(0, rest_1.param.path.number('id')),
103
- tslib_1.__param(1, rest_1.param.query.object('where', (0, rest_1.getWhereSchemaFor)(models_1.Todo))),
104
- tslib_1.__metadata("design:type", Function),
105
- tslib_1.__metadata("design:paramtypes", [Number, Object]),
106
- tslib_1.__metadata("design:returntype", Promise)
107
- ], TodoListTodoController.prototype, "delete", null);
108
- exports.TodoListTodoController = TodoListTodoController = tslib_1.__decorate([
109
- tslib_1.__param(0, (0, repository_1.repository)(repositories_1.TodoListRepository)),
110
- tslib_1.__metadata("design:paramtypes", [repositories_1.TodoListRepository])
111
- ], TodoListTodoController);
112
- //# sourceMappingURL=todo-list-todo.controller.js.map
113
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/todo-list-todo.controller.js.map
@@ -1,177 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TodoListController = 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 TodoListController = class TodoListController extends test_controller_base_1.TestControllerBase {
11
- constructor(todoListRepository) {
12
- super(todoListRepository);
13
- this.todoListRepository = todoListRepository;
14
- }
15
- async create(todoList) {
16
- return this.todoListRepository.create(todoList);
17
- }
18
- async count(where) {
19
- return this.todoListRepository.count(where);
20
- }
21
- async find(filter) {
22
- return this.todoListRepository.find(filter);
23
- }
24
- async updateAll(todoList, where) {
25
- return this.todoListRepository.updateAll(todoList, where);
26
- }
27
- async findById(id, filter) {
28
- return this.todoListRepository.findById(id, filter);
29
- }
30
- async updateById(id, todoList) {
31
- await this.todoListRepository.updateById(id, todoList);
32
- }
33
- async replaceById(id, todoList) {
34
- await this.todoListRepository.replaceById(id, todoList);
35
- }
36
- async deleteById(id) {
37
- await this.todoListRepository.deleteById(id);
38
- }
39
- async syncSequelizeModel() {
40
- await this.beforeEach({ syncAll: true });
41
- }
42
- };
43
- exports.TodoListController = TodoListController;
44
- tslib_1.__decorate([
45
- (0, rest_1.post)('/todo-lists'),
46
- (0, rest_1.response)(200, {
47
- description: 'TodoList model instance',
48
- content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.TodoList) } },
49
- }),
50
- tslib_1.__param(0, (0, rest_1.requestBody)({
51
- content: {
52
- 'application/json': {
53
- schema: (0, rest_1.getModelSchemaRef)(models_1.TodoList, {
54
- title: 'NewTodoList',
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
- ], TodoListController.prototype, "create", null);
64
- tslib_1.__decorate([
65
- (0, rest_1.get)('/todo-lists/count'),
66
- (0, rest_1.response)(200, {
67
- description: 'TodoList model count',
68
- content: { 'application/json': { schema: repository_1.CountSchema } },
69
- }),
70
- tslib_1.__param(0, rest_1.param.where(models_1.TodoList)),
71
- tslib_1.__metadata("design:type", Function),
72
- tslib_1.__metadata("design:paramtypes", [Object]),
73
- tslib_1.__metadata("design:returntype", Promise)
74
- ], TodoListController.prototype, "count", null);
75
- tslib_1.__decorate([
76
- (0, rest_1.get)('/todo-lists'),
77
- (0, rest_1.response)(200, {
78
- description: 'Array of TodoList model instances',
79
- content: {
80
- 'application/json': {
81
- schema: {
82
- type: 'array',
83
- items: (0, rest_1.getModelSchemaRef)(models_1.TodoList, { includeRelations: true }),
84
- },
85
- },
86
- },
87
- }),
88
- tslib_1.__param(0, rest_1.param.filter(models_1.TodoList)),
89
- tslib_1.__metadata("design:type", Function),
90
- tslib_1.__metadata("design:paramtypes", [Object]),
91
- tslib_1.__metadata("design:returntype", Promise)
92
- ], TodoListController.prototype, "find", null);
93
- tslib_1.__decorate([
94
- (0, rest_1.patch)('/todo-lists'),
95
- (0, rest_1.response)(200, {
96
- description: 'TodoList 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.TodoList, { partial: true }),
103
- },
104
- },
105
- })),
106
- tslib_1.__param(1, rest_1.param.where(models_1.TodoList)),
107
- tslib_1.__metadata("design:type", Function),
108
- tslib_1.__metadata("design:paramtypes", [models_1.TodoList, Object]),
109
- tslib_1.__metadata("design:returntype", Promise)
110
- ], TodoListController.prototype, "updateAll", null);
111
- tslib_1.__decorate([
112
- (0, rest_1.get)('/todo-lists/{id}'),
113
- (0, rest_1.response)(200, {
114
- description: 'TodoList model instance',
115
- content: {
116
- 'application/json': {
117
- schema: (0, rest_1.getModelSchemaRef)(models_1.TodoList, { 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.TodoList, { 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
- ], TodoListController.prototype, "findById", null);
127
- tslib_1.__decorate([
128
- (0, rest_1.patch)('/todo-lists/{id}'),
129
- (0, rest_1.response)(204, {
130
- description: 'TodoList 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.TodoList, { partial: true }),
137
- },
138
- },
139
- })),
140
- tslib_1.__metadata("design:type", Function),
141
- tslib_1.__metadata("design:paramtypes", [Number, models_1.TodoList]),
142
- tslib_1.__metadata("design:returntype", Promise)
143
- ], TodoListController.prototype, "updateById", null);
144
- tslib_1.__decorate([
145
- (0, rest_1.put)('/todo-lists/{id}'),
146
- (0, rest_1.response)(204, {
147
- description: 'TodoList 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.TodoList]),
153
- tslib_1.__metadata("design:returntype", Promise)
154
- ], TodoListController.prototype, "replaceById", null);
155
- tslib_1.__decorate([
156
- (0, rest_1.del)('/todo-lists/{id}'),
157
- (0, rest_1.response)(204, {
158
- description: 'TodoList 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
- ], TodoListController.prototype, "deleteById", null);
165
- tslib_1.__decorate([
166
- (0, rest_1.get)('/todo-lists/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
- ], TodoListController.prototype, "syncSequelizeModel", null);
172
- exports.TodoListController = TodoListController = tslib_1.__decorate([
173
- tslib_1.__param(0, (0, repository_1.repository)(repositories_1.TodoListRepository)),
174
- tslib_1.__metadata("design:paramtypes", [repositories_1.TodoListRepository])
175
- ], TodoListController);
176
- //# sourceMappingURL=todo-list.controller.js.map
177
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/todo-list.controller.js.map
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TodoTodoListController = 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 TodoTodoListController = class TodoTodoListController {
10
- constructor(todoRepository) {
11
- this.todoRepository = todoRepository;
12
- }
13
- async getTodoList(id) {
14
- return this.todoRepository.todoList(id);
15
- }
16
- };
17
- exports.TodoTodoListController = TodoTodoListController;
18
- tslib_1.__decorate([
19
- (0, rest_1.get)('/todos/{id}/todo-list', {
20
- responses: {
21
- '200': {
22
- description: 'TodoList belonging to Todo',
23
- content: {
24
- 'application/json': {
25
- schema: { type: 'array', items: (0, rest_1.getModelSchemaRef)(models_1.TodoList) },
26
- },
27
- },
28
- },
29
- },
30
- }),
31
- tslib_1.__param(0, rest_1.param.path.number('id')),
32
- tslib_1.__metadata("design:type", Function),
33
- tslib_1.__metadata("design:paramtypes", [Object]),
34
- tslib_1.__metadata("design:returntype", Promise)
35
- ], TodoTodoListController.prototype, "getTodoList", null);
36
- exports.TodoTodoListController = TodoTodoListController = tslib_1.__decorate([
37
- tslib_1.__param(0, (0, repository_1.repository)(repositories_1.TodoRepository)),
38
- tslib_1.__metadata("design:paramtypes", [repositories_1.TodoRepository])
39
- ], TodoTodoListController);
40
- //# sourceMappingURL=todo-todo-list.controller.js.map
41
- //# sourceMappingURL=/Users/dianalau/code/loopback/loopback-next/extensions/sequelize/dist/__tests__/fixtures/controllers/todo-todo-list.controller.js.map