@omen.foundation/node-microservice-runtime 0.1.115 → 0.1.116
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/package.json +1 -1
- package/scripts/publish-service.mjs +38 -27
package/package.json
CHANGED
|
@@ -753,7 +753,7 @@ async function discoverStorageObjects(srcDir, cwd = process.cwd()) {
|
|
|
753
753
|
// Resolve src path relative to current working directory (where publish is run from)
|
|
754
754
|
const srcPath = path.isAbsolute(srcDir) ? srcDir : path.resolve(cwd, srcDir || 'src');
|
|
755
755
|
|
|
756
|
-
console.log(`[beamo-node] Searching for @StorageObject decorators in: ${srcPath}`);
|
|
756
|
+
// Suppressed: console.log(`[beamo-node] Searching for @StorageObject decorators in: ${srcPath}`);
|
|
757
757
|
|
|
758
758
|
// Check if directory exists
|
|
759
759
|
try {
|
|
@@ -774,7 +774,7 @@ async function discoverStorageObjects(srcDir, cwd = process.cwd()) {
|
|
|
774
774
|
return storageObjects;
|
|
775
775
|
}
|
|
776
776
|
|
|
777
|
-
console.log(`[beamo-node] Scanning ${files.length} TypeScript file(s) for @StorageObject decorators...`);
|
|
777
|
+
// Suppressed: console.log(`[beamo-node] Scanning ${files.length} TypeScript file(s) for @StorageObject decorators...`);
|
|
778
778
|
|
|
779
779
|
for (const file of files) {
|
|
780
780
|
const content = await fs.readFile(file, 'utf-8');
|
|
@@ -792,15 +792,15 @@ async function discoverStorageObjects(srcDir, cwd = process.cwd()) {
|
|
|
792
792
|
archived: false, // Match C# CLI default (DeploymentService.cs line 1618)
|
|
793
793
|
checksum: null, // Not sent to backend, just for internal tracking
|
|
794
794
|
});
|
|
795
|
-
console.log(`[beamo-node] ✓ Discovered storage object: ${storageName} (from ${path.relative(cwd, file)})`);
|
|
795
|
+
// Suppressed: console.log(`[beamo-node] ✓ Discovered storage object: ${storageName} (from ${path.relative(cwd, file)})`);
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
|
|
800
|
-
if (storageObjects.length === 0) {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
}
|
|
800
|
+
// Suppressed: if (storageObjects.length === 0) {
|
|
801
|
+
// console.log(`[beamo-node] No @StorageObject decorators found in ${files.length} file(s) in ${srcPath}`);
|
|
802
|
+
// console.log(`[beamo-node] Make sure your storage classes are decorated with @StorageObject('StorageName')`);
|
|
803
|
+
// }
|
|
804
804
|
} catch (error) {
|
|
805
805
|
console.warn(`[beamo-node] Error discovering storage objects: ${error instanceof Error ? error.message : String(error)}`);
|
|
806
806
|
if (error instanceof Error && error.stack) {
|
|
@@ -975,7 +975,7 @@ async function updateManifest({
|
|
|
975
975
|
archived: s.archived !== undefined ? s.archived : false, // Always include archived, default to false like C# CLI
|
|
976
976
|
};
|
|
977
977
|
storageMap.set(s.id, newStorage);
|
|
978
|
-
console.log(`[beamo-node] Adding new storage to manifest: ${s.id} (type: ${newStorage.storageType}, enabled: ${newStorage.enabled})`);
|
|
978
|
+
// Suppressed: console.log(`[beamo-node] Adding new storage to manifest: ${s.id} (type: ${newStorage.storageType}, enabled: ${newStorage.enabled})`);
|
|
979
979
|
} else {
|
|
980
980
|
// Update existing storage to ensure storageType is 'mongov1' and format is correct
|
|
981
981
|
// Match C# CLI behavior: always set templateId="small" and archived=false (DeploymentService.cs lines 1618, 1620)
|
|
@@ -988,7 +988,7 @@ async function updateManifest({
|
|
|
988
988
|
archived: existing.archived !== undefined ? existing.archived : false, // Always include archived, default to false like C# CLI
|
|
989
989
|
};
|
|
990
990
|
storageMap.set(s.id, updatedStorage);
|
|
991
|
-
console.log(`[beamo-node] Updating existing storage in manifest: ${s.id} (type: mongov1, enabled: ${updatedStorage.enabled})`);
|
|
991
|
+
// Suppressed: console.log(`[beamo-node] Updating existing storage in manifest: ${s.id} (type: mongov1, enabled: ${updatedStorage.enabled})`);
|
|
992
992
|
}
|
|
993
993
|
});
|
|
994
994
|
// Convert to array and remove any extra fields (like checksum) that backend doesn't expect
|
|
@@ -1001,13 +1001,13 @@ async function updateManifest({
|
|
|
1001
1001
|
archived: s.archived !== undefined ? s.archived : false, // Always include archived, default to false like C# CLI
|
|
1002
1002
|
}));
|
|
1003
1003
|
|
|
1004
|
-
// Log storage references being sent to backend for debugging
|
|
1005
|
-
if (storageReferences.length > 0) {
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
}
|
|
1004
|
+
// Suppressed: Log storage references being sent to backend for debugging
|
|
1005
|
+
// if (storageReferences.length > 0) {
|
|
1006
|
+
// console.log(`[beamo-node] Publishing ${storageReferences.length} storage reference(s) to backend:`);
|
|
1007
|
+
// storageReferences.forEach(sr => {
|
|
1008
|
+
// console.log(`[beamo-node] - ${sr.id}: type=${sr.storageType}, enabled=${sr.enabled}, templateId=${sr.templateId || 'small'}`);
|
|
1009
|
+
// });
|
|
1010
|
+
// }
|
|
1011
1011
|
|
|
1012
1012
|
// Extract existing components and dependencies for the service
|
|
1013
1013
|
const existingServiceRef = serviceReferences.find(
|
|
@@ -1128,7 +1128,7 @@ async function updateManifest({
|
|
|
1128
1128
|
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
1129
1129
|
const manifestFile = path.join(publishHistoryDir, `manifest_${timestamp}.json`);
|
|
1130
1130
|
await fs.writeFile(manifestFile, JSON.stringify(requestBody, null, 2), 'utf8');
|
|
1131
|
-
console.log(`${colors.dim}Manifest saved to: ${manifestFile}${colors.reset}`);
|
|
1131
|
+
// Suppressed: console.log(`${colors.dim}Manifest saved to: ${manifestFile}${colors.reset}`);
|
|
1132
1132
|
} catch (err) {
|
|
1133
1133
|
console.log(`${colors.yellow}⚠${colors.reset} Could not save manifest to file: ${err.message}`);
|
|
1134
1134
|
}
|
|
@@ -1160,7 +1160,10 @@ async function updateManifest({
|
|
|
1160
1160
|
}
|
|
1161
1161
|
|
|
1162
1162
|
const responseBody = await response.json();
|
|
1163
|
-
|
|
1163
|
+
|
|
1164
|
+
// Collect success messages to return and display after progress bar
|
|
1165
|
+
const successMessages = [];
|
|
1166
|
+
successMessages.push(`${colors.green}✓${colors.reset} Manifest published successfully`);
|
|
1164
1167
|
|
|
1165
1168
|
// Always try to get and display the storage connection string if storage references exist
|
|
1166
1169
|
if (storageReferences.length > 0) {
|
|
@@ -1177,8 +1180,8 @@ async function updateManifest({
|
|
|
1177
1180
|
|
|
1178
1181
|
if (storageConnectionResponse.ok) {
|
|
1179
1182
|
const connectionString = await storageConnectionResponse.text();
|
|
1180
|
-
|
|
1181
|
-
|
|
1183
|
+
successMessages.push(`${colors.green}✓${colors.reset} MongoDB Connection String:`);
|
|
1184
|
+
successMessages.push(`${colors.cyan}${connectionString}${colors.reset}`);
|
|
1182
1185
|
} else {
|
|
1183
1186
|
const errorText = await storageConnectionResponse.text();
|
|
1184
1187
|
let errorMessage = errorText;
|
|
@@ -1188,17 +1191,19 @@ async function updateManifest({
|
|
|
1188
1191
|
} catch {
|
|
1189
1192
|
// Not JSON, use as-is
|
|
1190
1193
|
}
|
|
1191
|
-
|
|
1194
|
+
successMessages.push(`${colors.red}✗${colors.reset} Could not retrieve connection string: ${errorMessage}`);
|
|
1192
1195
|
if (errorMessage.includes('Could not open connection to database') ||
|
|
1193
1196
|
errorMessage.includes('Credentials have not been generated') ||
|
|
1194
1197
|
errorMessage.includes('storageGroupId')) {
|
|
1195
|
-
|
|
1198
|
+
successMessages.push(`${colors.yellow}⚠${colors.reset} This may prevent "Explore Data" from working. storageGroupId may not be set in the manifest.`);
|
|
1196
1199
|
}
|
|
1197
1200
|
}
|
|
1198
1201
|
} catch (err) {
|
|
1199
|
-
|
|
1202
|
+
successMessages.push(`${colors.yellow}⚠${colors.reset} Could not retrieve connection string: ${err.message}`);
|
|
1200
1203
|
}
|
|
1201
1204
|
}
|
|
1205
|
+
|
|
1206
|
+
return successMessages;
|
|
1202
1207
|
}
|
|
1203
1208
|
|
|
1204
1209
|
async function prepareDockerContext({ entry, distDir, openapiPath, packageJson, packageLock, nodeVersion }) {
|
|
@@ -1582,15 +1587,15 @@ async function main() {
|
|
|
1582
1587
|
storageType: 'mongov1', // MongoDB storage type (matches ServiceStorageReference in backend)
|
|
1583
1588
|
}));
|
|
1584
1589
|
|
|
1585
|
-
if (discoveredStorage.length > 0) {
|
|
1586
|
-
|
|
1587
|
-
}
|
|
1590
|
+
// Suppressed: if (discoveredStorage.length > 0) {
|
|
1591
|
+
// console.log(`[beamo-node] Discovered ${discoveredStorage.length} storage object(s): ${discoveredStorage.map(s => s.id).join(', ')}`);
|
|
1592
|
+
// }
|
|
1588
1593
|
|
|
1589
1594
|
progress.complete('Storage and components discovered');
|
|
1590
1595
|
|
|
1591
1596
|
// Step 8: Publish manifest
|
|
1592
1597
|
progress.start('Publishing manifest');
|
|
1593
|
-
await updateManifest({
|
|
1598
|
+
const successMessages = await updateManifest({
|
|
1594
1599
|
apiHost,
|
|
1595
1600
|
token,
|
|
1596
1601
|
cid,
|
|
@@ -1605,6 +1610,12 @@ async function main() {
|
|
|
1605
1610
|
packageJson: packageJsonPath,
|
|
1606
1611
|
});
|
|
1607
1612
|
progress.complete('Manifest published');
|
|
1613
|
+
|
|
1614
|
+
// Display success messages after progress bar completes
|
|
1615
|
+
if (successMessages && successMessages.length > 0) {
|
|
1616
|
+
console.log(''); // New line after progress bar
|
|
1617
|
+
successMessages.forEach(msg => console.log(msg));
|
|
1618
|
+
}
|
|
1608
1619
|
|
|
1609
1620
|
// Success message
|
|
1610
1621
|
console.log(`\n${colors.green}${colors.bright}✓ Publish complete!${colors.reset}`);
|