antenna-fyi 1.2.12 ā 1.2.13
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 +2 -2
- package/lib/core.js +2 -0
- package/lib/hermes-plugin/tools.py +7 -0
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -179,7 +179,7 @@ export async function handleEvent(f) {
|
|
|
179
179
|
|
|
180
180
|
if (f.create || (!f.join && !f.scan && !f.end && f.name)) {
|
|
181
181
|
if (!f.name) return console.error("Usage: antenna event --create --name 'AI Meetup' [--desc 'description'] [--og-image 'url']");
|
|
182
|
-
const result = await createEvent({ name: f.name, device_id: f.id || null, lat: f.lat ? +f.lat : undefined, lng: f.lng ? +f.lng : undefined, description: f.desc || undefined, og_image: f['og-image'] || undefined });
|
|
182
|
+
const result = await createEvent({ name: f.name, device_id: f.id || null, lat: f.lat ? +f.lat : undefined, lng: f.lng ? +f.lng : undefined, description: f.desc || undefined, og_image: f['og-image'] || undefined, requires_approval: f['requires-approval'] === true || f['requires-approval'] === 'true' || undefined, screening_questions: f['screening-questions'] ? f['screening-questions'].split('|') : undefined });
|
|
183
183
|
console.log(`\nš Event created!\n`);
|
|
184
184
|
console.log(` Name: ${result.name}`);
|
|
185
185
|
console.log(` Code: ${result.code}`);
|
|
@@ -190,7 +190,7 @@ export async function handleEvent(f) {
|
|
|
190
190
|
|
|
191
191
|
if (f.join) {
|
|
192
192
|
if (!f.code || !f.id) return console.error("Usage: antenna event --join --code abc123 --id telegram:123");
|
|
193
|
-
const result = await joinEvent({ code: f.code, device_id: f.id });
|
|
193
|
+
const result = await joinEvent({ code: f.code, device_id: f.id, lat: f.lat ? +f.lat : undefined, lng: f.lng ? +f.lng : undefined, application_context: f['application-context'] || undefined });
|
|
194
194
|
if (result.joined) {
|
|
195
195
|
console.log(`\nā
Joined "${result.name}" (${result.code})\n`);
|
|
196
196
|
} else {
|
package/lib/core.js
CHANGED
|
@@ -555,6 +555,8 @@ export async function joinEvent({ code, device_id, lat, lng, application_context
|
|
|
555
555
|
const { data, error } = await sb.rpc("join_event", {
|
|
556
556
|
p_code: code,
|
|
557
557
|
p_device_id: device_id,
|
|
558
|
+
p_lat: (lat != null && lng != null) ? fuzzyCoord(lat, lng).lat : null,
|
|
559
|
+
p_lng: (lat != null && lng != null) ? fuzzyCoord(lat, lng).lng : null,
|
|
558
560
|
p_application_context: application_context || null,
|
|
559
561
|
});
|
|
560
562
|
if (error) throw new Error(error.message);
|
|
@@ -383,6 +383,10 @@ def handle_event_create(params: dict) -> str:
|
|
|
383
383
|
rpc_params["p_description"] = params["description"]
|
|
384
384
|
if params.get("og_image"):
|
|
385
385
|
rpc_params["p_og_image"] = params["og_image"]
|
|
386
|
+
if params.get("requires_approval"):
|
|
387
|
+
rpc_params["p_requires_approval"] = params["requires_approval"]
|
|
388
|
+
if params.get("screening_questions"):
|
|
389
|
+
rpc_params["p_screening_questions"] = params["screening_questions"]
|
|
386
390
|
|
|
387
391
|
resp = sb.rpc("create_event", rpc_params).execute()
|
|
388
392
|
data = resp.data or {}
|
|
@@ -423,6 +427,9 @@ def handle_event_join(params: dict) -> str:
|
|
|
423
427
|
resp = sb.rpc("join_event", {
|
|
424
428
|
"p_device_id": did,
|
|
425
429
|
"p_code": params["code"],
|
|
430
|
+
"p_lat": lat,
|
|
431
|
+
"p_lng": lng,
|
|
432
|
+
"p_application_context": params.get("application_context"),
|
|
426
433
|
}).execute()
|
|
427
434
|
data = resp.data or {}
|
|
428
435
|
|