@layer-ai/core 0.8.1 → 0.8.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/gates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAQpD,QAAA,MAAM,MAAM,EAAE,UAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/gates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AAQpD,QAAA,MAAM,MAAM,EAAE,UAAqB,CAAC;AA0cpC,eAAe,MAAM,CAAC"}
|
package/dist/routes/v1/gates.js
CHANGED
|
@@ -128,6 +128,8 @@ router.patch('/name/:name', async (req, res) => {
|
|
|
128
128
|
res.status(400).json({ error: 'bad_request', message: `Unsupported model: ${model}` });
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
+
// Create history snapshot before update
|
|
132
|
+
await db.createGateHistory(existing.id, existing, 'user');
|
|
131
133
|
const updated = await db.updateGate(existing.id, {
|
|
132
134
|
description,
|
|
133
135
|
taskType,
|
|
@@ -146,6 +148,10 @@ router.patch('/name/:name', async (req, res) => {
|
|
|
146
148
|
reanalysisPeriod,
|
|
147
149
|
taskAnalysis,
|
|
148
150
|
});
|
|
151
|
+
// Log manual update activity
|
|
152
|
+
await db.createActivityLog(existing.id, req.userId, 'manual_update', {
|
|
153
|
+
changedFields: Object.keys(req.body)
|
|
154
|
+
});
|
|
149
155
|
await cache.invalidateGate(req.userId, existing.name);
|
|
150
156
|
res.json(updated);
|
|
151
157
|
}
|
|
@@ -175,6 +181,8 @@ router.patch('/:id', async (req, res) => {
|
|
|
175
181
|
res.status(400).json({ error: 'bad_request', message: `Unsupported model: ${model}` });
|
|
176
182
|
return;
|
|
177
183
|
}
|
|
184
|
+
// Create history snapshot before update
|
|
185
|
+
await db.createGateHistory(req.params.id, existing, 'user');
|
|
178
186
|
const updated = await db.updateGate(req.params.id, {
|
|
179
187
|
description,
|
|
180
188
|
taskType,
|
|
@@ -193,6 +201,10 @@ router.patch('/:id', async (req, res) => {
|
|
|
193
201
|
reanalysisPeriod,
|
|
194
202
|
taskAnalysis,
|
|
195
203
|
});
|
|
204
|
+
// Log manual update activity
|
|
205
|
+
await db.createActivityLog(req.params.id, req.userId, 'manual_update', {
|
|
206
|
+
changedFields: Object.keys(req.body)
|
|
207
|
+
});
|
|
196
208
|
await cache.invalidateGate(req.userId, existing.name);
|
|
197
209
|
res.json(updated);
|
|
198
210
|
}
|