arckode-framework 1.0.7 → 1.0.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.
- package/kernel/framework.ts +17 -0
- package/package.json +1 -1
package/kernel/framework.ts
CHANGED
|
@@ -518,11 +518,28 @@ export class ORM {
|
|
|
518
518
|
|
|
519
519
|
private deserializeFromDb(def: ModelDefinition, row: ModelResult): ModelResult {
|
|
520
520
|
const result = { ...row } as Record<string, unknown>
|
|
521
|
+
|
|
522
|
+
// Deserializar campos JSON almacenados como string
|
|
521
523
|
for (const [k, field] of Object.entries(def.fields)) {
|
|
522
524
|
if (field.type === 'json' && typeof result[k] === 'string') {
|
|
523
525
|
try { result[k] = JSON.parse(result[k] as string) } catch { /* no es JSON válido */ }
|
|
524
526
|
}
|
|
525
527
|
}
|
|
528
|
+
|
|
529
|
+
// Normalizar timestamps que PostgreSQL devuelve en minúscula
|
|
530
|
+
// PostgreSQL baja el case de identificadores no-quoted: createdAt → createdat
|
|
531
|
+
const tsMap: Record<string, string> = {
|
|
532
|
+
createdat: 'createdAt',
|
|
533
|
+
updatedat: 'updatedAt',
|
|
534
|
+
deletedat: 'deletedAt',
|
|
535
|
+
}
|
|
536
|
+
for (const [lower, camel] of Object.entries(tsMap)) {
|
|
537
|
+
if (lower in result && !(camel in result)) {
|
|
538
|
+
result[camel] = result[lower]
|
|
539
|
+
delete result[lower]
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
526
543
|
return result as ModelResult
|
|
527
544
|
}
|
|
528
545
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arckode-framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "AI-first TypeScript/Bun framework. Modular, SOLID, zero magic. The AI reads the composition root and knows everything.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./kernel/framework.ts",
|