streamby-core 0.10.7 → 0.10.8

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.
@@ -129,16 +129,7 @@ function createStreamByRouter(config) {
129
129
  });
130
130
  router.patch('/projects/:id', async (req, res) => {
131
131
  try {
132
- const auth = await config.authProvider(req);
133
- if (auth.role !== 'admin' && auth.role !== 'editor') {
134
- return res.status(403).json({ error: 'Permission denied' });
135
- }
136
- const projectId = req.params.id;
137
- const updates = req.body;
138
- if (!updates || typeof updates !== 'object') {
139
- return res.status(400).json({ error: 'Missing updates payload' });
140
- }
141
- const updated = await config.projectProvider.update(projectId, updates);
132
+ const updated = await (0, project_1.updateProjectService)(req, config.authProvider, config.projectProvider);
142
133
  res.status(200).json({ success: true, project: updated });
143
134
  }
144
135
  catch (err) {
@@ -147,15 +138,6 @@ function createStreamByRouter(config) {
147
138
  });
148
139
  router.delete('/projects/:id', async (req, res) => {
149
140
  try {
150
- const auth = await config.authProvider(req);
151
- const projectId = req.params.id;
152
- const project = await config.projectProvider.getById(projectId);
153
- if (!project) {
154
- return res.status(404).json({ error: 'Project not found' });
155
- }
156
- if (!isProjectMember(project, auth.userId)) {
157
- return res.status(403).json({ error: 'Unauthorized project access' });
158
- }
159
141
  await (0, project_1.deleteProjectService)(req, config.authProvider, config.projectProvider);
160
142
  res.status(200).json({ success: true });
161
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streamby-core",
3
- "version": "0.10.7",
3
+ "version": "0.10.8",
4
4
  "description": "StreamBy middleware framework for media storage management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",