antenna-fyi 1.3.32 → 1.3.33
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/lib/cli.js +14 -4
- package/lib/core.js +2 -3
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -81,8 +81,21 @@ export async function handleProfile(f) {
|
|
|
81
81
|
if (f.contact !== undefined) payload.contact_info = f.contact;
|
|
82
82
|
if (visible !== undefined) payload.visible = visible;
|
|
83
83
|
const data = await setProfile(payload);
|
|
84
|
+
if (data?.error) {
|
|
85
|
+
console.error("❌ " + data.error);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
84
88
|
console.log("✅ Profile saved");
|
|
85
|
-
console.log(
|
|
89
|
+
if (data?.display_name) console.log(` ${data.display_name}`);
|
|
90
|
+
if (data?.personal_description) console.log(` ${data.personal_description}`);
|
|
91
|
+
if (data?.looking_for) console.log(` Looking for: ${data.looking_for}`);
|
|
92
|
+
if (data?.conversation_style) console.log(` Conversation: ${data.conversation_style}`);
|
|
93
|
+
if (data?.contact_info) console.log(` 📇 Contact: ${data.contact_info}`);
|
|
94
|
+
if (data?.public_url) console.log(` 🔗 ${data.public_url}`);
|
|
95
|
+
else if (data?.profile_slug) console.log(` 🔗 https://www.antenna.fyi/p/${data.profile_slug}`);
|
|
96
|
+
if (data?.warnings?.length) {
|
|
97
|
+
for (const w of data.warnings) console.log(` ⚠️ ${w}`);
|
|
98
|
+
}
|
|
86
99
|
} else {
|
|
87
100
|
const data = await getProfile({ device_id: id });
|
|
88
101
|
if (!data) return console.log("No profile yet. Create one with --name and --personal-description");
|
|
@@ -90,9 +103,6 @@ export async function handleProfile(f) {
|
|
|
90
103
|
if (data.personal_description) console.log(` ${data.personal_description}`);
|
|
91
104
|
if (data.looking_for) console.log(` Looking for: ${data.looking_for}`);
|
|
92
105
|
if (data.conversation_style) console.log(` Conversation: ${data.conversation_style}`);
|
|
93
|
-
if (data.line1 && data.line1 !== data.personal_description) console.log(` Line 1: ${data.line1}`);
|
|
94
|
-
if (data.line2 && data.line2 !== data.looking_for) console.log(` Line 2: ${data.line2}`);
|
|
95
|
-
if (data.line3 && data.line3 !== data.conversation_style) console.log(` Line 3: ${data.line3}`);
|
|
96
106
|
if (data.interest_tags?.length) console.log(` Tags: ${data.interest_tags.join(", ")}`);
|
|
97
107
|
if (data.city) console.log(` 📍 ${data.city}`);
|
|
98
108
|
if (data.contact_info) console.log(` 📇 Contact: ${data.contact_info}`);
|
package/lib/core.js
CHANGED
|
@@ -335,9 +335,8 @@ export async function setProfile({
|
|
|
335
335
|
if (!profileSlug && display_name) {
|
|
336
336
|
const slug = display_name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").substring(0, 30);
|
|
337
337
|
if (slug) {
|
|
338
|
-
const {
|
|
339
|
-
if (
|
|
340
|
-
profileSlug = slug;
|
|
338
|
+
const { data: slugResult } = await sb.rpc("set_profile_slug", { p_device_id: device_id, p_slug: slug });
|
|
339
|
+
if (slugResult?.set) profileSlug = slug;
|
|
341
340
|
}
|
|
342
341
|
}
|
|
343
342
|
if (profileSlug) {
|