@crmforall/connect 0.1.4 → 0.1.6
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/commands/init.js +9 -7
- package/dist/index.js +12 -3
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -49,11 +49,12 @@ async function collectDbSettings(json) {
|
|
|
49
49
|
if (json || !(0, prompts_1.isInteractive)()) {
|
|
50
50
|
return (0, contracts_1.jsonError)("init", contracts_1.ERROR_CODE.AUTH_FAILED, "비대화형 실행에서는 CRMFORALL_DB_URL(+CRMFORALL_DB_PASSWORD) 환경변수가 필요합니다. 비밀번호를 명령 인자로 넘기지 마세요.");
|
|
51
51
|
}
|
|
52
|
-
console.log("\nDB 접속
|
|
53
|
-
|
|
52
|
+
console.log("\nDB 접속 정보를 입력하세요. (읽기 전용 계정 + crmforall 스키마 CREATE 권한 권장)");
|
|
53
|
+
console.log("비밀번호는 화면에 표시되지 않고, 명령 인자·로그에 남지 않습니다.\n");
|
|
54
|
+
const host = await (0, prompts_1.prompt)("호스트 (예: db.internal.shop.com / localhost)");
|
|
54
55
|
const port = Number(await (0, prompts_1.prompt)("포트", "5432"));
|
|
55
|
-
const database = await (0, prompts_1.prompt)("데이터베이스");
|
|
56
|
-
const user = await (0, prompts_1.prompt)("사용자");
|
|
56
|
+
const database = await (0, prompts_1.prompt)("데이터베이스 이름 (예: shop)");
|
|
57
|
+
const user = await (0, prompts_1.prompt)("사용자 (예: cfa_reader)");
|
|
57
58
|
const password = await (0, prompts_1.promptHidden)("비밀번호 (입력 비표시)");
|
|
58
59
|
const ssl = (await (0, prompts_1.prompt)("SSL 사용? (y/N)", "N")).toLowerCase() === "y";
|
|
59
60
|
return { sourceType: "postgresql", host, port, database, user, password, ssl };
|
|
@@ -157,9 +158,10 @@ async function runInit(opts) {
|
|
|
157
158
|
crmSchema: config.crmSchema,
|
|
158
159
|
ready: true,
|
|
159
160
|
nextSteps: [
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"
|
|
161
|
+
"① (선택) 진단 재확인: npx @crmforall/connect doctor",
|
|
162
|
+
"② AI에 커넥터 등록: claude mcp add crmforall-connector -- npx -y @crmforall/connector",
|
|
163
|
+
'③ Claude에서 한마디: "크렘포올 커넥터 온보딩을 진행해줘" → 진단·매핑이 자동 진행돼요',
|
|
164
|
+
"④ 실시간 동기화(선택): npx @crmforall/connect sync --watch",
|
|
163
165
|
],
|
|
164
166
|
});
|
|
165
167
|
}
|
package/dist/index.js
CHANGED
|
@@ -10,15 +10,24 @@ const program = new commander_1.Command();
|
|
|
10
10
|
program
|
|
11
11
|
.name("connect")
|
|
12
12
|
.description("crmforall 커넥터 설치/진단 CLI. AI 도구(Claude Code 등)로 운전하려면 패키지의 AGENTS.md를 참조하세요.")
|
|
13
|
-
.version("0.1.
|
|
13
|
+
.version("0.1.6");
|
|
14
14
|
function emit(result, asJson) {
|
|
15
15
|
if (asJson) {
|
|
16
16
|
console.log(JSON.stringify(result, null, 2));
|
|
17
17
|
}
|
|
18
18
|
else if (result.ok) {
|
|
19
19
|
console.log(`✓ ${result.command} 완료`);
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const data = result.data;
|
|
21
|
+
if (data) {
|
|
22
|
+
const { nextSteps, ...rest } = data;
|
|
23
|
+
if (Object.keys(rest).length)
|
|
24
|
+
console.log(JSON.stringify(rest, null, 2));
|
|
25
|
+
if (Array.isArray(nextSteps) && nextSteps.length) {
|
|
26
|
+
console.log("\n다음 단계:");
|
|
27
|
+
for (const s of nextSteps)
|
|
28
|
+
console.log(` ${s}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
22
31
|
}
|
|
23
32
|
else {
|
|
24
33
|
console.error(`✗ ${result.command} 실패 [${result.error?.code}]`);
|