@pmate/cli 0.50.4 → 0.50.5

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -18724,6 +18724,15 @@ function readNamespaceFromPayload(payload) {
18724
18724
  return namespace.trim().toLowerCase();
18725
18725
  }
18726
18726
 
18727
+ // src/services/ManualInfraRouting.ts
18728
+ function usesManualInfraRouting(service) {
18729
+ const id = service.id ?? `${service.namespace}:${service.name}`;
18730
+ if (/^pmate:(?:blockchain|(?:[a-z0-9-]+-)?indexer|qablk01|qaidx)$/.test(id)) return true;
18731
+ const repository = service.repository ?? service.network?.repository;
18732
+ return repository === "parrot-mate/pmate-rust" && /(?:^|\/)infra\/scripts\/(?:blockchain|(?:[a-z0-9-]+-)?indexer)(?:\.[a-z0-9-]+)?$/.test(service.runner?.script ?? "");
18733
+ }
18734
+ var MANUAL_INFRA_ROUTING_MESSAGE = "Indexer/Blockchain ingress is managed manually. Edit the versioned Nginx configuration, run nginx -t, then reload Nginx separately.";
18735
+
18727
18736
  // src/commands/ServiceCommandHandler.ts
18728
18737
  var import_node_fs29 = require("fs");
18729
18738
  var import_promises5 = require("fs/promises");
@@ -21226,6 +21235,10 @@ var ServiceRuntimeRunner = class {
21226
21235
  return site;
21227
21236
  }
21228
21237
  async initServerApp(service, options, config) {
21238
+ if (usesManualInfraRouting(service)) {
21239
+ ui.info(MANUAL_INFRA_ROUTING_MESSAGE);
21240
+ return;
21241
+ }
21229
21242
  const network = this.getNetwork(service);
21230
21243
  const subdomain = "subdomain" in network ? network.subdomain?.trim() : void 0;
21231
21244
  const port = network.port;
@@ -22463,6 +22476,9 @@ var ServiceCommandHandler = class {
22463
22476
  return;
22464
22477
  }
22465
22478
  case "service-env-expose": {
22479
+ const [namespace, name] = args.appId.split(":");
22480
+ const service = await registry.getService(namespace, name);
22481
+ if (usesManualInfraRouting(service)) throw new Error(MANUAL_INFRA_ROUTING_MESSAGE);
22466
22482
  const payload = await this.request(
22467
22483
  baseUrl2,
22468
22484
  "POST",
@@ -23009,6 +23025,10 @@ var ServiceCommandHandler = class {
23009
23025
  }
23010
23026
  }
23011
23027
  async deleteServerResources(service) {
23028
+ if (usesManualInfraRouting(service)) {
23029
+ ui.info(MANUAL_INFRA_ROUTING_MESSAGE);
23030
+ return;
23031
+ }
23012
23032
  const network = this.getNetworkConfig(service);
23013
23033
  const subdomain = network.subdomain?.trim();
23014
23034
  if (!subdomain) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.50.4",
3
+ "version": "0.50.5",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {