@treeseed/sdk 0.6.45 → 0.6.46

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.
@@ -396,6 +396,16 @@ async function waitForRailwayManagedDeploymentsSettled(tenantRoot, scope, {
396
396
  pollMs = 15e3
397
397
  } = {}) {
398
398
  const deadline = Date.now() + timeoutMs;
399
+ const environment = resolveRailwayEnvironmentForScope(scope);
400
+ const projectId = services.find((service) => typeof service.projectId === "string" && service.projectId.trim())?.projectId ?? null;
401
+ if (projectId) {
402
+ runRailway(["link", "--project", projectId, "--environment", environment, "--json"], {
403
+ cwd: tenantRoot,
404
+ capture: true,
405
+ allowFailure: true,
406
+ env
407
+ });
408
+ }
399
409
  let checks = [];
400
410
  let lastError = null;
401
411
  for (; ; ) {
@@ -417,7 +427,7 @@ async function waitForRailwayManagedDeploymentsSettled(tenantRoot, scope, {
417
427
  type: "deployment-status",
418
428
  service: service.key,
419
429
  serviceName: service.serviceName,
420
- environment: resolveRailwayEnvironmentForScope(scope),
430
+ environment,
421
431
  ok: false,
422
432
  status: "status_error",
423
433
  message: error instanceof Error ? error.message : String(error)
@@ -968,6 +978,7 @@ async function verifyRailwayManagedResources(tenantRoot, scope, {
968
978
  const effectiveEnv = { ...env, RAILWAY_API_TOKEN: effectiveApiToken, TREESEED_RAILWAY_API_URL: effectiveApiUrl };
969
979
  const services = configuredRailwayServices(tenantRoot, scope);
970
980
  const checks = [];
981
+ const deploymentStatusServices = [];
971
982
  for (const service of services) {
972
983
  const target = await resolveRailwayScheduleTarget({
973
984
  projectId: service.projectId,
@@ -994,6 +1005,10 @@ async function verifyRailwayManagedResources(tenantRoot, scope, {
994
1005
  });
995
1006
  continue;
996
1007
  }
1008
+ deploymentStatusServices.push({
1009
+ ...service,
1010
+ projectId: target.project.id
1011
+ });
997
1012
  const instance = await getRailwayServiceInstance({
998
1013
  serviceId: target.service.id,
999
1014
  environmentId: target.environment.id,
@@ -1065,7 +1080,7 @@ async function verifyRailwayManagedResources(tenantRoot, scope, {
1065
1080
  }
1066
1081
  if (settleDeployments) {
1067
1082
  const settled = await waitForRailwayManagedDeploymentsSettled(tenantRoot, scope, {
1068
- services,
1083
+ services: deploymentStatusServices.length > 0 ? deploymentStatusServices : services,
1069
1084
  env: effectiveEnv,
1070
1085
  timeoutMs: settleTimeoutMs,
1071
1086
  pollMs: settlePollMs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.6.45",
3
+ "version": "0.6.46",
4
4
  "description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {