makea-cli 0.1.17__tar.gz → 0.1.18__tar.gz
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.
- {makea_cli-0.1.17 → makea_cli-0.1.18}/PKG-INFO +2 -1
- {makea_cli-0.1.17 → makea_cli-0.1.18}/README.md +1 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/api_client.py +5 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/directory/cmd.py +81 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/supplier/cmd.py +1 -2
- {makea_cli-0.1.17 → makea_cli-0.1.18}/pyproject.toml +1 -1
- {makea_cli-0.1.17 → makea_cli-0.1.18}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/.claude/skills/link-supplier-user/SKILL.md +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/.gitignore +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea-collection-upload/SKILL.md +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea-collection-upload/scripts/create_products.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/__main__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/auth_pkce.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/_util.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/analytics/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/analytics/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/auth/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/auth/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/designer/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/designer/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/directory/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/document/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/document/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/email/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/email/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/library/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/library/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/metrics/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/metrics/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/orders/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/orders/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/product/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/product/cmd.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/commands/supplier/__init__.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/config.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/main.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/makea_cli/posthog_client.py +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/npm/makea-cli/README.md +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/npm/makea-cli/makea-cli.mjs +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/npm/makea-cli/package.json +0 -0
- {makea_cli-0.1.17 → makea_cli-0.1.18}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: makea-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.18
|
|
4
4
|
Summary: Makea admin CLI (browser login + Makea admin HTTP API)
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: httpx>=0.27
|
|
@@ -77,6 +77,7 @@ makea-cli auth --logout
|
|
|
77
77
|
- `makea-cli auth` — 浏览器登录并保存令牌
|
|
78
78
|
- `makea-cli auth --logout` — 清除本机令牌
|
|
79
79
|
- `makea-cli list-users` — 列出用户(需管理员权限)
|
|
80
|
+
- `makea-cli create-user <email> --user-type "<type>" [--password ...] [--name ...] [--company-name ...] [--username ...]` — 注册用户并直接确认 Cognito 账号(POST `/admin/users/create`,不发验证码邮件,创建后即可用该密码登录)
|
|
80
81
|
- `makea-cli list-suppliers` — 列出供应商(需管理员权限)
|
|
81
82
|
- `makea-cli create-quote-request -s <supplier_id> -p <product_reference_id> [--quote-type SAMPLING|PRODUCTION] [--message ...] [--due-date YYYY-MM-DD]` — 创建并发送 quote request(POST `/admin/supplier/create_quote_request`)
|
|
82
83
|
- `makea-cli get-quote-requests-by-supplier-id <supplier_id> [--status <status>] [-n <limit>]` — 直连后端按 supplier_id 查询 quote requests
|
|
@@ -66,6 +66,7 @@ makea-cli auth --logout
|
|
|
66
66
|
- `makea-cli auth` — 浏览器登录并保存令牌
|
|
67
67
|
- `makea-cli auth --logout` — 清除本机令牌
|
|
68
68
|
- `makea-cli list-users` — 列出用户(需管理员权限)
|
|
69
|
+
- `makea-cli create-user <email> --user-type "<type>" [--password ...] [--name ...] [--company-name ...] [--username ...]` — 注册用户并直接确认 Cognito 账号(POST `/admin/users/create`,不发验证码邮件,创建后即可用该密码登录)
|
|
69
70
|
- `makea-cli list-suppliers` — 列出供应商(需管理员权限)
|
|
70
71
|
- `makea-cli create-quote-request -s <supplier_id> -p <product_reference_id> [--quote-type SAMPLING|PRODUCTION] [--message ...] [--due-date YYYY-MM-DD]` — 创建并发送 quote request(POST `/admin/supplier/create_quote_request`)
|
|
71
72
|
- `makea-cli get-quote-requests-by-supplier-id <supplier_id> [--status <status>] [-n <limit>]` — 直连后端按 supplier_id 查询 quote requests
|
|
@@ -208,6 +208,11 @@ def get_all_users(*, limit: int | None, offset: int) -> Any:
|
|
|
208
208
|
return get_json("/admin/users", params=params)
|
|
209
209
|
|
|
210
210
|
|
|
211
|
+
def create_user(body: dict[str, Any], *, timeout: float = 60.0) -> Any:
|
|
212
|
+
"""POST /admin/users/create — admin registers a confirmed Cognito user + DDB profile."""
|
|
213
|
+
return post_json("/admin/users/create", body, timeout=timeout)
|
|
214
|
+
|
|
215
|
+
|
|
211
216
|
def update_user_profile(*, user_id: str, body: dict[str, Any]) -> Any:
|
|
212
217
|
"""PUT /admin/user-profiles/{user_id}/update — admin updates DDB profile + Cognito userType."""
|
|
213
218
|
return put_json(f"/admin/user-profiles/{user_id}/update", body)
|
|
@@ -47,6 +47,87 @@ def register(app: typer.Typer) -> None:
|
|
|
47
47
|
"""
|
|
48
48
|
print_json_or_exit(console, lambda: api_client.get_all_users(limit=limit, offset=offset))
|
|
49
49
|
|
|
50
|
+
@app.command(
|
|
51
|
+
"create-user",
|
|
52
|
+
help=(
|
|
53
|
+
"POST /admin/users/create — register a user and confirm the Cognito "
|
|
54
|
+
"account in one step (no verification email). Allowed --user-type values: "
|
|
55
|
+
'"Fashion brands", "Other brands", "Supply Chain Consultant/Freelancer", '
|
|
56
|
+
'"Supplier", "ADMIN".'
|
|
57
|
+
),
|
|
58
|
+
)
|
|
59
|
+
def create_user(
|
|
60
|
+
email: str = typer.Argument(
|
|
61
|
+
...,
|
|
62
|
+
help="Email address; also the Cognito username unless --username is given.",
|
|
63
|
+
),
|
|
64
|
+
user_type: str = typer.Option(
|
|
65
|
+
...,
|
|
66
|
+
"--user-type",
|
|
67
|
+
help=(
|
|
68
|
+
"Cognito custom:userType for the new account. One of: "
|
|
69
|
+
'"Fashion brands", "Other brands", "Supply Chain Consultant/Freelancer", '
|
|
70
|
+
'"Supplier", "ADMIN" (case- and punctuation-sensitive).'
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
password: str = typer.Option(
|
|
74
|
+
...,
|
|
75
|
+
"--password",
|
|
76
|
+
prompt=True,
|
|
77
|
+
hide_input=True,
|
|
78
|
+
confirmation_prompt=True,
|
|
79
|
+
help=(
|
|
80
|
+
"Initial password; set as permanent, so the user signs in with it "
|
|
81
|
+
"directly. Must satisfy the Cognito pool policy. Prompted when omitted."
|
|
82
|
+
),
|
|
83
|
+
),
|
|
84
|
+
name: str | None = typer.Option(
|
|
85
|
+
None,
|
|
86
|
+
"--name",
|
|
87
|
+
help="Optional display name (Cognito ``name`` + profile user_name).",
|
|
88
|
+
),
|
|
89
|
+
company_name: str | None = typer.Option(
|
|
90
|
+
None,
|
|
91
|
+
"--company-name",
|
|
92
|
+
help="Optional company name written to the DDB profile row.",
|
|
93
|
+
),
|
|
94
|
+
username: str | None = typer.Option(
|
|
95
|
+
None,
|
|
96
|
+
"--username",
|
|
97
|
+
help="Optional Cognito username when it should differ from the email.",
|
|
98
|
+
),
|
|
99
|
+
) -> None:
|
|
100
|
+
"""
|
|
101
|
+
Admin: create a ready-to-use account (Cognito + DynamoDB profile).
|
|
102
|
+
|
|
103
|
+
The account is created with email_verified true and the password made
|
|
104
|
+
permanent, so it lands in CONFIRMED and the user can sign in immediately.
|
|
105
|
+
Cognito sends no invitation or verification email — pass the password on
|
|
106
|
+
yourself.
|
|
107
|
+
|
|
108
|
+
Output: JSON with success, user_id (Cognito sub), username, user_type,
|
|
109
|
+
status and profile_created.
|
|
110
|
+
"""
|
|
111
|
+
if user_type not in _ALLOWED_USER_TYPES:
|
|
112
|
+
console.print(
|
|
113
|
+
f"[red]--user-type must be exactly one of {list(_ALLOWED_USER_TYPES)}.[/red]"
|
|
114
|
+
)
|
|
115
|
+
raise typer.Exit(1)
|
|
116
|
+
|
|
117
|
+
body: dict[str, object] = {
|
|
118
|
+
"email": email,
|
|
119
|
+
"password": password,
|
|
120
|
+
"user_type": user_type,
|
|
121
|
+
}
|
|
122
|
+
if name is not None:
|
|
123
|
+
body["user_name"] = name
|
|
124
|
+
if company_name is not None:
|
|
125
|
+
body["company_name"] = company_name
|
|
126
|
+
if username is not None:
|
|
127
|
+
body["username"] = username
|
|
128
|
+
|
|
129
|
+
print_json_or_exit(console, lambda: api_client.create_user(body))
|
|
130
|
+
|
|
50
131
|
@app.command(
|
|
51
132
|
"update-user-profile",
|
|
52
133
|
help=(
|
|
@@ -211,8 +211,7 @@ def register(app: typer.Typer) -> None:
|
|
|
211
211
|
resolved_id = supplier_id or raw.get("supplier_id") or body["supplier"].get("supplier_id")
|
|
212
212
|
if not resolved_id:
|
|
213
213
|
console.print(
|
|
214
|
-
"[red]supplier_id is required: pass --supplier-id or include it in the "
|
|
215
|
-
"JSON.[/red]"
|
|
214
|
+
"[red]supplier_id is required: pass --supplier-id or include it in the JSON.[/red]"
|
|
216
215
|
)
|
|
217
216
|
raise typer.Exit(1)
|
|
218
217
|
body["supplier_id"] = resolved_id
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|