connectbase-client 3.5.1 → 3.5.3
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/CHANGELOG.md +48 -0
- package/dist/cli.js +23 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,54 @@
|
|
|
3
3
|
본 SDK 의 모든 주요 변경사항을 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/) 형식으로 기록합니다.
|
|
4
4
|
버전은 [Semantic Versioning](https://semver.org/lang/ko/) 을 따릅니다.
|
|
5
5
|
|
|
6
|
+
## [3.5.3] - 2026-05-01
|
|
7
|
+
|
|
8
|
+
### Fixed — `connectbase tunnel --label` 의 `tunnel_id` 추출 실패
|
|
9
|
+
|
|
10
|
+
3.5.2 의 `parseArgs()` 패치로 `--label` / `--description` 이 정상 파싱되어
|
|
11
|
+
`registerEndpointBinding()` 까지 호출되는 것은 확인됐으나, 함수 진입 직후
|
|
12
|
+
`tunnel_id` 추출 단계에서 즉시 skip 되어 자동 등록이 여전히 한 번도
|
|
13
|
+
수행되지 않던 문제를 수정했습니다.
|
|
14
|
+
|
|
15
|
+
원인: 추출 로직이 `https://<id>.tunnel.connectbase.world` (subdomain 기반)
|
|
16
|
+
형식을 가정했으나, 실제 발급 URL 은 `https://tunnel.connectbase.world/<id>`
|
|
17
|
+
(path 기반) 입니다. `host.replace(/\.tunnel\.connectbase\.world$/, '')` 가
|
|
18
|
+
정규식 매칭에 실패해 입력을 그대로 반환 → `tunnelId === host` 조건으로
|
|
19
|
+
"tunnel_id 추출 실패" 분기 진입 → 자동 등록 skip.
|
|
20
|
+
|
|
21
|
+
- URL 파싱을 제거하고, 서버가 `tunnel_ready` 메시지에 직접 실어 보내는
|
|
22
|
+
`tunnel_id` 필드를 그대로 사용하도록 변경 (서버 권위값 기준 — 향후 URL
|
|
23
|
+
형식 변경에 영향받지 않음).
|
|
24
|
+
- `registerEndpointBinding()` 시그니처: `tunnelUrl` → `tunnelId` 로 단순화 +
|
|
25
|
+
`export` 노출 → 단위 테스트 가능.
|
|
26
|
+
- `test/cli-register-endpoint.test.ts` 회귀 가드 5 케이스 신규 추가:
|
|
27
|
+
201 (정상 등록 — body.tunnel_id 검증), description 기본값, baseUrl trailing
|
|
28
|
+
slash 정규화, appId URL 인코딩, 409/401/5xx/네트워크 오류 시 호출부
|
|
29
|
+
흐름 유지 (throw 하지 않음).
|
|
30
|
+
|
|
31
|
+
회귀 영향 범위: 3.5.2 의 `--label` 자동 등록 사용자 (해당 기능을 처음으로
|
|
32
|
+
정상 동작시킴). 다른 옵션 / 기본 `tunnel` 동작에는 영향 없음.
|
|
33
|
+
|
|
34
|
+
## [3.5.2] - 2026-05-01
|
|
35
|
+
|
|
36
|
+
### Fixed — `connectbase tunnel --label` / `--description` 옵션이 파싱되지 않던 문제
|
|
37
|
+
|
|
38
|
+
3.5.1 의 인증 헤더 / `await` 수정에도 불구하고 `--label` / `--description` 으로
|
|
39
|
+
endpoint binding 자동 등록이 한 번도 트리거되지 않던 문제를 수정했습니다.
|
|
40
|
+
원인은 `parseArgs()` 의 옵션 파싱 분기 자체가 두 옵션을 매칭하지 않아
|
|
41
|
+
`parsed.options.label === undefined` 로 떨어지고, 결과적으로
|
|
42
|
+
`if (tunnelOpts?.label && tunnelUrl)` 가드가 항상 false 가 되어
|
|
43
|
+
`registerEndpointBinding()` 이 호출되지 않았던 것입니다.
|
|
44
|
+
|
|
45
|
+
- `parseArgs()` 의 while 루프에 `--label` / `--description` 분기 추가
|
|
46
|
+
(기존 `--storage` / `--max-body` 와 동일 패턴).
|
|
47
|
+
- `parseArgs()` 를 `export` 로 노출 + `test/cli-parse-args.test.ts` 회귀 테스트
|
|
48
|
+
추가 — `--label` 단독 / `--label` + `--description` 조합 / 미지정 / `--description`
|
|
49
|
+
단독 4 가지 케이스를 검증해 동일 회귀 차단.
|
|
50
|
+
|
|
51
|
+
회귀 영향 범위: 3.5.1 에서 `--label` / `--description` 을 사용했던 모든 호출
|
|
52
|
+
(즉 endpoint binding 자동 등록 기능 전체). 다른 옵션·기본 `tunnel` 동작에는 영향 없음.
|
|
53
|
+
|
|
6
54
|
## [3.5.1] - 2026-05-01
|
|
7
55
|
|
|
8
56
|
### Fixed — `connectbase tunnel --label` endpoint 자동 등록 401
|
package/dist/cli.js
CHANGED
|
@@ -33,6 +33,8 @@ var cli_exports = {};
|
|
|
33
33
|
__export(cli_exports, {
|
|
34
34
|
computeDeployDiff: () => computeDeployDiff,
|
|
35
35
|
normalizeRelativePath: () => normalizeRelativePath,
|
|
36
|
+
parseArgs: () => parseArgs,
|
|
37
|
+
registerEndpointBinding: () => registerEndpointBinding,
|
|
36
38
|
sha256Hex: () => sha256Hex
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(cli_exports);
|
|
@@ -1565,15 +1567,8 @@ ${colors.blue}?${colors.reset} \uC571 \uC120\uD0DD (\uBC88\uD638): `);
|
|
|
1565
1567
|
success(`\uC571 \uC0DD\uC131 \uC644\uB8CC: ${createData.app_name}`);
|
|
1566
1568
|
return { appId: createData.app_id, publicKey: createData.public_key };
|
|
1567
1569
|
}
|
|
1568
|
-
async function registerEndpointBinding(baseUrl, appId, secretKey,
|
|
1570
|
+
async function registerEndpointBinding(baseUrl, appId, secretKey, tunnelId, label, description) {
|
|
1569
1571
|
try {
|
|
1570
|
-
const u = new URL(tunnelUrl);
|
|
1571
|
-
const host = u.hostname;
|
|
1572
|
-
const tunnelId = host.replace(/\.tunnel\.connectbase\.world$/, "");
|
|
1573
|
-
if (!tunnelId || tunnelId === host) {
|
|
1574
|
-
error(`tunnel_id \uCD94\uCD9C \uC2E4\uD328 (${tunnelUrl}) \u2014 endpoint "${label}" \uC790\uB3D9 \uB4F1\uB85D skip`);
|
|
1575
|
-
return;
|
|
1576
|
-
}
|
|
1577
1572
|
const apiBase = baseUrl.replace(/\/+$/, "");
|
|
1578
1573
|
const res = await fetch(`${apiBase}/v1/apps/${encodeURIComponent(appId)}/endpoints/cli`, {
|
|
1579
1574
|
method: "POST",
|
|
@@ -1836,15 +1831,20 @@ ${colors.dim}\uC678\uBD80 \uC9C1\uC811 \uD638\uCD9C \uC2DC \uB2E4\uC74C \uD5E4\u
|
|
|
1836
1831
|
log(`${colors.dim} $ curl -H "X-Proxy-Token: ${proxyToken}" ${tunnelUrl}/${colors.reset}`);
|
|
1837
1832
|
log(`${colors.dim} $ curl "${tunnelUrl}/?proxy_token=${proxyToken}"${colors.reset}`);
|
|
1838
1833
|
}
|
|
1839
|
-
if (tunnelOpts?.label
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1834
|
+
if (tunnelOpts?.label) {
|
|
1835
|
+
const tunnelId = typeof msg.tunnel_id === "string" ? msg.tunnel_id : "";
|
|
1836
|
+
if (!tunnelId) {
|
|
1837
|
+
error(`tunnel_ready \uBA54\uC2DC\uC9C0\uC5D0 tunnel_id \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 endpoint "${tunnelOpts.label}" \uC790\uB3D9 \uB4F1\uB85D skip`);
|
|
1838
|
+
} else {
|
|
1839
|
+
await registerEndpointBinding(
|
|
1840
|
+
config.baseUrl,
|
|
1841
|
+
appId,
|
|
1842
|
+
tunnelKey,
|
|
1843
|
+
tunnelId,
|
|
1844
|
+
tunnelOpts.label,
|
|
1845
|
+
tunnelOpts.description
|
|
1846
|
+
);
|
|
1847
|
+
}
|
|
1848
1848
|
}
|
|
1849
1849
|
log(`
|
|
1850
1850
|
${colors.dim}Ctrl+C\uB85C \uC885\uB8CC${colors.reset}
|
|
@@ -2093,6 +2093,10 @@ function parseArgs(args) {
|
|
|
2093
2093
|
result.options.timeout = args[++i];
|
|
2094
2094
|
} else if (arg === "--max-body") {
|
|
2095
2095
|
result.options.maxBody = args[++i];
|
|
2096
|
+
} else if (arg === "--label") {
|
|
2097
|
+
result.options.label = args[++i];
|
|
2098
|
+
} else if (arg === "--description") {
|
|
2099
|
+
result.options.description = args[++i];
|
|
2096
2100
|
} else if (arg === "-a" || arg === "--app") {
|
|
2097
2101
|
result.options.appId = args[++i];
|
|
2098
2102
|
} else if (arg === "--force") {
|
|
@@ -2221,5 +2225,7 @@ main().catch((err) => {
|
|
|
2221
2225
|
0 && (module.exports = {
|
|
2222
2226
|
computeDeployDiff,
|
|
2223
2227
|
normalizeRelativePath,
|
|
2228
|
+
parseArgs,
|
|
2229
|
+
registerEndpointBinding,
|
|
2224
2230
|
sha256Hex
|
|
2225
2231
|
});
|