@pmate/cli 0.28.3 → 0.28.4

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 +10 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12554,6 +12554,7 @@ var DevCommandHandler = class {
12554
12554
  // src/commands/OssCommandHandler.ts
12555
12555
  var import_node_fs6 = require("fs");
12556
12556
  var import_node_path10 = __toESM(require("path"));
12557
+ var PARROT_STATIC_PUBLIC_BASE_URL = "https://parrot-static.pmate.chat";
12557
12558
  var OssCommandHandler = class _OssCommandHandler {
12558
12559
  static {
12559
12560
  this.DEFAULT_BUCKET = "parrot-static";
@@ -12575,6 +12576,10 @@ var OssCommandHandler = class _OssCommandHandler {
12575
12576
  const objectKey = this.normalizeObjectKey(args.objectKey);
12576
12577
  const bucket = this.resolveBucket(args.bucket);
12577
12578
  await AliyunService.uploadFile(resolvedFile, bucket, objectKey);
12579
+ const publicUrl = buildOssPublicUrl(bucket, objectKey);
12580
+ if (publicUrl) {
12581
+ ui.plain(publicUrl);
12582
+ }
12578
12583
  }
12579
12584
  assertFile(filePath) {
12580
12585
  if (!(0, import_node_fs6.existsSync)(filePath)) {
@@ -12600,6 +12605,11 @@ var OssCommandHandler = class _OssCommandHandler {
12600
12605
  return _OssCommandHandler.DEFAULT_BUCKET;
12601
12606
  }
12602
12607
  };
12608
+ function buildOssPublicUrl(bucket, objectKey) {
12609
+ if (bucket !== "parrot-static") return null;
12610
+ const encodedKey = objectKey.split("/").map((segment) => encodeURIComponent(segment)).join("/");
12611
+ return `${PARROT_STATIC_PUBLIC_BASE_URL}/${encodedKey}`;
12612
+ }
12603
12613
 
12604
12614
  // src/commands/EnvCommandHandler.ts
12605
12615
  var import_node_path11 = __toESM(require("path"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.28.3",
3
+ "version": "0.28.4",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {