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