@kmlckj/licos-platform-sdk 0.3.0 → 0.4.0
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/README.md +2 -0
- package/package.json +1 -1
- package/src/shared.js +4 -2
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@ LICOS 平台对象存储 SDK,兼容前端和后端调用。
|
|
|
5
5
|
## 后端模式
|
|
6
6
|
|
|
7
7
|
- `baseUrl` / `token` / `userId` / `projectId` 不传时,会回退读取 `LICOS_*` 环境变量
|
|
8
|
+
- 后端默认读取 `LICOS_ORCHESTRATOR_API_BASE_URL`
|
|
9
|
+
- 这些存储接口实际挂在调度器 `/api/v1/storage/*` 和 `/api/v1/public/storage/*`
|
|
8
10
|
- `uploadUser` / `uploadProject` 支持直接传本地文件路径
|
|
9
11
|
- `download(url, outputPath)` 会把文件写到本地路径
|
|
10
12
|
|
package/package.json
CHANGED
package/src/shared.js
CHANGED
|
@@ -36,7 +36,7 @@ export function normalizeBaseUrl(baseUrl) {
|
|
|
36
36
|
return baseUrl.replace(/\/+$/, '');
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const envBaseUrl = readEnv('
|
|
39
|
+
const envBaseUrl = readEnv('LICOS_ORCHESTRATOR_API_BASE_URL');
|
|
40
40
|
if (envBaseUrl) {
|
|
41
41
|
return envBaseUrl.replace(/\/+$/, '');
|
|
42
42
|
}
|
|
@@ -45,7 +45,9 @@ export function normalizeBaseUrl(baseUrl) {
|
|
|
45
45
|
return '';
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
throw new ConfigurationError(
|
|
48
|
+
throw new ConfigurationError(
|
|
49
|
+
'Missing required environment variable: LICOS_ORCHESTRATOR_API_BASE_URL',
|
|
50
|
+
);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
export function resolveUserId(userId) {
|