@omen.foundation/node-microservice-runtime 0.1.84 → 0.1.85

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.84",
3
+ "version": "0.1.85",
4
4
  "description": "Beamable microservice runtime for Node.js/TypeScript services.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -509,16 +509,16 @@ async function uploadDockerImage({
509
509
  progress,
510
510
  }) {
511
511
  const baseUrl = `${registryUrl}${uniqueName}/`;
512
- // Match C# CLI exactly: use x-ks-* headers (all lowercase) with CID, PID (realm PID), and access token
513
- // Note: Backend might check using gamePid, but C# CLI uses realm PID for upload headers
512
+ // Try using gamePid in headers - backend checks registry using game PID scope
513
+ // The uniqueName is calculated with gamePid, so headers should match
514
514
  const headers = {
515
515
  'x-ks-clientid': cid,
516
- 'x-ks-projectid': pid, // Use realm PID (not gamePid) - matches ctx.Pid in C# CLI
516
+ 'x-ks-projectid': gamePid || pid, // Use gamePid if available, fallback to realm PID
517
517
  'x-ks-token': token, // Access token from login
518
518
  };
519
519
  if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
520
520
  console.error(`[beamo-node] Uploading to: ${baseUrl}`);
521
- console.error(`[beamo-node] Upload headers PID: ${pid} (realm), gamePid: ${gamePid}`);
521
+ console.error(`[beamo-node] Upload headers PID: ${gamePid || pid} (gamePid: ${gamePid}, realm: ${pid})`);
522
522
  }
523
523
 
524
524
  const { manifestEntry, configBuffer, layers } = await readDockerImageTar(imageTarPath);
@@ -1134,6 +1134,32 @@ async function main() {
1134
1134
  });
1135
1135
  progress.complete('Image uploaded');
1136
1136
 
1137
+ // Verify image exists in registry before proceeding
1138
+ const shortImageId = shortDigest(fullImageId);
1139
+ const baseUrl = `${registryUrl}${uniqueName}/`;
1140
+ const verifyHeaders = {
1141
+ 'x-ks-clientid': cid,
1142
+ 'x-ks-projectid': resolvedGamePid || pid, // Use gamePid to match registry scope
1143
+ 'x-ks-token': token,
1144
+ };
1145
+
1146
+ if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
1147
+ console.error(`[beamo-node] Verifying image exists: ${baseUrl}manifests/${shortImageId}`);
1148
+ console.error(`[beamo-node] Verify headers:`, verifyHeaders);
1149
+ }
1150
+
1151
+ // Wait a moment for registry to propagate
1152
+ await new Promise(resolve => setTimeout(resolve, 3000));
1153
+
1154
+ const imageExists = await verifyManifestExists(baseUrl, shortImageId, verifyHeaders);
1155
+ if (!imageExists) {
1156
+ throw new Error(`Image verification failed: manifest with tag ${shortImageId} not found in registry at ${baseUrl}manifests/${shortImageId}. The image may not have uploaded successfully.`);
1157
+ }
1158
+
1159
+ if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
1160
+ console.error(`[beamo-node] ✓ Image verification passed: ${baseUrl}manifests/${shortImageId}`);
1161
+ }
1162
+
1137
1163
  // Step 7: Discover storage, components, and dependencies
1138
1164
  progress.start('Discovering storage objects and components');
1139
1165
  const shortImageId = shortDigest(fullImageId);