@omen.foundation/node-microservice-runtime 0.1.109 → 0.1.111

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omen.foundation/node-microservice-runtime",
3
- "version": "0.1.109",
3
+ "version": "0.1.111",
4
4
  "description": "Beamable microservice runtime for Node.js/TypeScript services.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1135,18 +1135,82 @@ async function updateManifest({
1135
1135
 
1136
1136
  if (!response.ok) {
1137
1137
  const text = await response.text();
1138
- // if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
1139
- // console.error(`[beamo-node] Response Body: ${text}`);
1140
- // console.error(`[beamo-node] Full Request Body (for debugging):`, JSON.stringify(requestBody, null, 2));
1141
- // }
1138
+ console.error(`\n${colors.red}✗${colors.reset} Failed to publish manifest: ${response.status}`);
1139
+ console.error(`Response: ${text}`);
1142
1140
  throw new Error(`Failed to publish manifest: ${response.status} ${text}`);
1143
1141
  }
1144
1142
 
1145
1143
  const responseBody = await response.json();
1146
- // if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
1147
- // console.error(`[beamo-node] Response Body:`, JSON.stringify(responseBody, null, 2));
1148
- // console.error(`[beamo-node] ✓ Manifest published successfully`);
1149
- // }
1144
+ console.log(`\n${colors.green}✓${colors.reset} Manifest published successfully`);
1145
+ console.log(`${colors.dim}Backend Response:${colors.reset}`, JSON.stringify(responseBody, null, 2));
1146
+
1147
+ // After publishing, fetch the current manifest to see what was stored
1148
+ // Note: ManifestView doesn't include storageGroupId, but we can at least verify storageReferences
1149
+ try {
1150
+ const currentManifestUrl = new URL('/basic/beamo/manifest/current', apiHost);
1151
+ const currentManifestResponse = await fetch(currentManifestUrl, {
1152
+ method: 'GET',
1153
+ headers: {
1154
+ Authorization: `Bearer ${token}`,
1155
+ Accept: 'application/json',
1156
+ 'X-BEAM-SCOPE': `${cid}.${pid}`,
1157
+ },
1158
+ });
1159
+
1160
+ if (currentManifestResponse.ok) {
1161
+ const currentManifest = await currentManifestResponse.json();
1162
+ console.log(`\n${colors.cyan}=== CURRENT MANIFEST (as stored in backend) ===${colors.reset}`);
1163
+ console.log(JSON.stringify(currentManifest, null, 2));
1164
+ console.log(`${colors.cyan}=== END CURRENT MANIFEST ===${colors.reset}\n`);
1165
+
1166
+ // Check if storage references are present
1167
+ if (currentManifest?.manifest?.storageReference) {
1168
+ console.log(`${colors.green}✓${colors.reset} Storage references found in stored manifest: ${currentManifest.manifest.storageReference.length} reference(s)`);
1169
+ currentManifest.manifest.storageReference.forEach(sr => {
1170
+ console.log(` - ${sr.id}: type=${sr.storageType}, enabled=${sr.enabled}, templateId=${sr.templateId || 'N/A'}, archived=${sr.archived || false}`);
1171
+ });
1172
+
1173
+ // Try to verify storage connection is accessible (this tests if storageGroupId is set)
1174
+ // Note: This requires admin permissions, so it might fail, but it's useful for debugging
1175
+ if (storageReferences.length > 0) {
1176
+ try {
1177
+ const storageConnectionUrl = new URL('/basic/beamo/storage/connection', apiHost);
1178
+ const storageConnectionResponse = await fetch(storageConnectionUrl, {
1179
+ method: 'GET',
1180
+ headers: {
1181
+ Authorization: `Bearer ${token}`,
1182
+ Accept: 'application/json',
1183
+ 'X-BEAM-SCOPE': `${cid}.${pid}`,
1184
+ },
1185
+ });
1186
+
1187
+ if (storageConnectionResponse.ok) {
1188
+ const connectionString = await storageConnectionResponse.text();
1189
+ console.log(`${colors.green}✓${colors.reset} Storage connection string is accessible (storageGroupId is set)`);
1190
+ console.log(`${colors.dim}Connection string preview: ${connectionString.substring(0, 50)}...${colors.reset}`);
1191
+ } else {
1192
+ const errorText = await storageConnectionResponse.text();
1193
+ console.log(`${colors.yellow}⚠${colors.reset} Storage connection endpoint returned: ${storageConnectionResponse.status}`);
1194
+ console.log(`${colors.dim}Error: ${errorText}${colors.reset}`);
1195
+ if (errorText.includes('Credentials have not been generated') || errorText.includes('storageGroupId')) {
1196
+ console.log(`${colors.red}✗${colors.reset} ${colors.bright}ISSUE DETECTED: storageGroupId may not be set in the manifest!${colors.reset}`);
1197
+ console.log(`${colors.dim}This could be why "Explore Data" doesn't work. The backend needs storageGroupId to generate connection strings.${colors.reset}`);
1198
+ }
1199
+ }
1200
+ } catch (err) {
1201
+ console.log(`${colors.yellow}⚠${colors.reset} Could not test storage connection endpoint: ${err.message}`);
1202
+ console.log(`${colors.dim}(This might require admin permissions)${colors.reset}`);
1203
+ }
1204
+ }
1205
+ } else {
1206
+ console.log(`${colors.yellow}⚠${colors.reset} No storage references found in stored manifest`);
1207
+ }
1208
+ } else {
1209
+ console.log(`${colors.yellow}⚠${colors.reset} Could not fetch current manifest: ${currentManifestResponse.status}`);
1210
+ }
1211
+ } catch (err) {
1212
+ console.log(`${colors.yellow}⚠${colors.reset} Could not fetch current manifest: ${err.message}`);
1213
+ }
1150
1214
  }
1151
1215
 
1152
1216
  async function prepareDockerContext({ entry, distDir, openapiPath, packageJson, packageLock, nodeVersion }) {