ai-project-manage-cli 8.0.13 → 8.0.14

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/dist/index.js CHANGED
@@ -196,10 +196,6 @@ var init_request_config = __esm({
196
196
  method: "GET",
197
197
  path: "/cli/apm-log-storage"
198
198
  }),
199
- getDeployArtifactStorage: defineEndpoint({
200
- method: "GET",
201
- path: "/cli/deploy-artifact-storage"
202
- }),
203
199
  projectPackageUpdateStatus: defineEndpoint({
204
200
  method: "PUT",
205
201
  path: "/cli/project-packages/status"
@@ -100,10 +100,6 @@ var requestConfig = {
100
100
  method: "GET",
101
101
  path: "/cli/apm-log-storage"
102
102
  }),
103
- getDeployArtifactStorage: defineEndpoint({
104
- method: "GET",
105
- path: "/cli/deploy-artifact-storage"
106
- }),
107
103
  projectPackageUpdateStatus: defineEndpoint({
108
104
  method: "PUT",
109
105
  path: "/cli/project-packages/status"
@@ -2527,7 +2523,8 @@ async function createApmLogMinioClient(cfg) {
2527
2523
  accessKey: storage.accessKey,
2528
2524
  secretKey: storage.secretKey
2529
2525
  }),
2530
- bucket: storage.bucket
2526
+ bucket: storage.bucket,
2527
+ ...storage.publicEndpoint ? { publicEndpoint: storage.publicEndpoint } : {}
2531
2528
  };
2532
2529
  }
2533
2530
 
@@ -3993,28 +3990,6 @@ async function handleStartProject(cfg, msg, signal) {
3993
3990
  // src/commands/connect/upload-package-artifact.ts
3994
3991
  import fs from "node:fs";
3995
3992
  import path from "node:path";
3996
-
3997
- // src/commands/connect/deploy-artifact-minio.ts
3998
- async function fetchDeployArtifactStorage(cfg) {
3999
- const api = createApmApiClient(cfg);
4000
- return api.cli.getDeployArtifactStorage(void 0);
4001
- }
4002
- async function createDeployArtifactMinioClient(cfg) {
4003
- const storage = await fetchDeployArtifactStorage(cfg);
4004
- return {
4005
- client: new MinioClient({
4006
- endPoint: storage.endpoint,
4007
- port: storage.port,
4008
- useSSL: storage.useSsl,
4009
- accessKey: storage.accessKey,
4010
- secretKey: storage.secretKey
4011
- }),
4012
- bucket: storage.bucket,
4013
- ...storage.publicEndpoint ? { publicEndpoint: storage.publicEndpoint } : {}
4014
- };
4015
- }
4016
-
4017
- // src/commands/connect/upload-package-artifact.ts
4018
3993
  function packageTmpDir(packageId) {
4019
3994
  return `/data/package-tmp/${packageId}`;
4020
3995
  }
@@ -4022,9 +3997,10 @@ function expectedLocalArtifactPath(target, packageId) {
4022
3997
  const fileName = target === "frontend" ? "dist.zip" : "jars.zip";
4023
3998
  return path.join(packageTmpDir(packageId), fileName);
4024
3999
  }
4025
- function packageArtifactObjectKey(target, packageId) {
4026
- const fileName = target === "frontend" ? "dist.zip" : "jars.zip";
4027
- return `packages/${target}/${packageId}/${fileName}`;
4000
+ function packageArtifactObjectKey(target, projectId, timestampMs = Date.now()) {
4001
+ const folder = target === "frontend" ? "vue" : "java";
4002
+ const suffix = target === "frontend" ? "dist.zip" : "jar.zip";
4003
+ return `packages/${projectId}/${folder}/${timestampMs}.${suffix}`;
4028
4004
  }
4029
4005
  function removePackageTmpDir(packageId) {
4030
4006
  const dir = packageTmpDir(packageId);
@@ -4037,7 +4013,7 @@ function removePackageTmpDir(packageId) {
4037
4013
  );
4038
4014
  }
4039
4015
  }
4040
- async function uploadPackageArtifact(cfg, target, packageId) {
4016
+ async function uploadPackageArtifact(cfg, target, packageId, projectId) {
4041
4017
  const localPath = expectedLocalArtifactPath(target, packageId);
4042
4018
  if (!fs.existsSync(localPath)) {
4043
4019
  throw new Error(`\u6253\u5305\u4EA7\u7269\u4E0D\u5B58\u5728: ${localPath}`);
@@ -4046,8 +4022,8 @@ async function uploadPackageArtifact(cfg, target, packageId) {
4046
4022
  if (!stat.isFile() || stat.size <= 0) {
4047
4023
  throw new Error(`\u6253\u5305\u4EA7\u7269\u65E0\u6548\u6216\u4E3A\u7A7A: ${localPath}`);
4048
4024
  }
4049
- const objectKey = packageArtifactObjectKey(target, packageId);
4050
- const { client, bucket, publicEndpoint } = await createDeployArtifactMinioClient(cfg);
4025
+ const objectKey = packageArtifactObjectKey(target, projectId);
4026
+ const { client, bucket, publicEndpoint } = await createApmLogMinioClient(cfg);
4051
4027
  await client.ensureBucket(bucket);
4052
4028
  await client.fPutObject(bucket, objectKey, localPath, {
4053
4029
  "Content-Type": "application/zip"
@@ -4298,7 +4274,7 @@ async function handleWebIdePackage(cfg, msg, signal) {
4298
4274
  }
4299
4275
  const uploaded = await runPrepStep(
4300
4276
  "\u4E0A\u4F20\u6253\u5305\u4EA7\u7269\u5230 MinIO",
4301
- () => uploadPackageArtifact(cfg, msg.target, packageId),
4277
+ () => uploadPackageArtifact(cfg, msg.target, packageId, projectId),
4302
4278
  (result) => `objectKey=${result.artifactPath}${result.artifactUrl ? ` url=${result.artifactUrl}` : ""}`
4303
4279
  );
4304
4280
  await updatePackageStatus(cfg, packageId, "SUCCESS", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-manage-cli",
3
- "version": "8.0.13",
3
+ "version": "8.0.14",
4
4
  "description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
5
5
  "type": "module",
6
6
  "private": false,