@tenonhq/sincronia-core 0.0.40 → 0.0.41
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/dist/appUtils.js +4 -22
- package/package.json +1 -1
package/dist/appUtils.js
CHANGED
|
@@ -61,34 +61,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
61
61
|
const metadataFiles = [];
|
|
62
62
|
const regularFiles = [];
|
|
63
63
|
rec.files.forEach((file) => {
|
|
64
|
-
if (file.name ===
|
|
64
|
+
if (file.name === "metaData" && file.type === "json") {
|
|
65
65
|
metadataFiles.push(file);
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
68
|
regularFiles.push(file);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
-
// Write metadata files with updated _generatedAt field
|
|
72
|
-
const metadataPromises = metadataFiles.map(async (file) => {
|
|
73
|
-
if (file.content) {
|
|
74
|
-
try {
|
|
75
|
-
const metadata = JSON.parse(file.content);
|
|
76
|
-
// Update _generatedAt with sys_updated_on value if it exists
|
|
77
|
-
if (metadata.sys_updated_on && metadata.sys_updated_on.value) {
|
|
78
|
-
metadata._generatedAt = metadata.sys_updated_on.value;
|
|
79
|
-
}
|
|
80
|
-
// Write the updated metadata
|
|
81
|
-
file.content = JSON.stringify(metadata, null, 2);
|
|
82
|
-
}
|
|
83
|
-
catch (e) {
|
|
84
|
-
// If parsing fails, just write as-is
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return fileWrite(file, recPath);
|
|
88
|
-
});
|
|
89
71
|
// Write regular files
|
|
90
72
|
const regularPromises = regularFiles.map((file) => fileWrite(file, recPath));
|
|
91
|
-
await Promise.all([...
|
|
73
|
+
await Promise.all([...regularPromises]);
|
|
92
74
|
// Remove content from ALL files and exclude metadata from manifest
|
|
93
75
|
rec.files = regularFiles.map((file) => {
|
|
94
76
|
const fileCopy = { ...file };
|
|
@@ -147,14 +129,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
147
129
|
Logger_1.logger.info("Finding and creating missing files...");
|
|
148
130
|
await (0, exports.processMissingFiles)(newManifest);
|
|
149
131
|
// Update the in-memory manifest for this scope
|
|
150
|
-
if (typeof curManifest ===
|
|
132
|
+
if (typeof curManifest === "object" && !curManifest.tables) {
|
|
151
133
|
curManifest[scope] = newManifest;
|
|
152
134
|
ConfigManager.updateManifest(curManifest);
|
|
153
135
|
}
|
|
154
136
|
}
|
|
155
137
|
else {
|
|
156
138
|
// Sync all scopes if manifest has multiple scopes
|
|
157
|
-
if (typeof curManifest ===
|
|
139
|
+
if (typeof curManifest === "object" && !curManifest.tables) {
|
|
158
140
|
// Multiple scopes detected
|
|
159
141
|
for (const scopeName of Object.keys(curManifest)) {
|
|
160
142
|
await (0, exports.syncManifest)(scopeName);
|