create-entity-server 0.5.4 → 0.5.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-entity-server",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "Create a new entity-server project in one command — like create-react-app or create-vite.",
5
5
  "keywords": [
6
6
  "entity-server",
@@ -18,6 +18,37 @@ if [ -f .env ]; then
18
18
  fi
19
19
  LANGUAGE=${LANGUAGE:-ko}
20
20
 
21
+ # entity-cli api-key 서브커맨드를 공통 경로로 실행합니다.
22
+ run_api_key_cli() {
23
+ ENTITY_CLI_NAME="api-key" "$BIN_PATH" api-key "$@"
24
+ }
25
+
26
+ # list 출력 테이블에서 seq 목록만 추출합니다.
27
+ extract_api_key_seqs() {
28
+ run_api_key_cli list "$@" | awk '
29
+ /^[[:space:]]*[0-9]+[[:space:]]/ {
30
+ print $1
31
+ }
32
+ '
33
+ }
34
+
35
+ # list 결과를 show 상세 블록으로 다시 출력합니다.
36
+ print_revealed_api_key_list() {
37
+ local -a seqs
38
+ mapfile -t seqs < <(extract_api_key_seqs "$@")
39
+
40
+ if [ ${#seqs[@]} -eq 0 ]; then
41
+ run_api_key_cli list "$@"
42
+ return
43
+ fi
44
+
45
+ local seq
46
+ for seq in "${seqs[@]}"; do
47
+ run_api_key_cli show --seq="$seq" --reveal-secret || return $?
48
+ echo ""
49
+ done
50
+ }
51
+
21
52
  show_help() {
22
53
  if [ "$LANGUAGE" = "en" ]; then
23
54
  echo "API Key Management (CLI mode)"
@@ -36,6 +67,7 @@ show_help() {
36
67
  echo ""
37
68
  echo "list options:"
38
69
  echo " --limit=<n> Max rows to show (default: 20)"
70
+ echo " Each row is expanded with full key_value/hmac_secret"
39
71
  echo ""
40
72
  echo "add options:"
41
73
  echo " --role=<name> Role name (default: admin)"
@@ -72,6 +104,7 @@ show_help() {
72
104
  echo ""
73
105
  echo "list 옵션:"
74
106
  echo " --limit=<n> 최대 출력 행 수 (기본: 20)"
107
+ echo " 각 항목을 key_value, hmac_secret 전체 값으로 펼쳐서 출력"
75
108
  echo ""
76
109
  echo "add 옵션:"
77
110
  echo " --role=<이름> 역할명 (기본: admin)"
@@ -114,8 +147,11 @@ SUBCOMMAND="$1"
114
147
  shift
115
148
 
116
149
  case "$SUBCOMMAND" in
117
- list|show|add|delete)
118
- ENTITY_CLI_NAME="api-key" "$BIN_PATH" api-key "$SUBCOMMAND" "$@"
150
+ list)
151
+ print_revealed_api_key_list "$@"
152
+ ;;
153
+ show|add|delete)
154
+ run_api_key_cli "$SUBCOMMAND" "$@"
119
155
  ;;
120
156
  help|-h|--help)
121
157
  show_help