Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions partiful
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function stripMarkdown(text) {
return text
.replace(/\*\*(.*?)\*\*/g, '$1') // bold
.replace(/\*(.*?)\*/g, '$1') // italic
.replace(/\[(.*?)\]\(.*?\)/g, '$1') // links
.replace(/\[(.*?)\]\((.*?)\)/g, '$1 ($2)') // links — keep URL
.replace(/#{1,6}\s+/g, '') // headings
.replace(/`(.*?)`/g, '$1') // inline code
.replace(/~~(.*?)~~/g, '$1') // strikethrough
Expand Down Expand Up @@ -594,7 +594,14 @@ async function createEvent(options) {
timezone: timezone,
location: options.location || null,
address: options.address || null,
description: stripMarkdown(options.description) || null,
description: (() => {
let desc = stripMarkdown(options.description) || '';
if (options.link) {
const linkLabel = options.linkText || 'Link';
desc += (desc ? '\n\n' : '') + linkLabel + ': ' + options.link;
}
return desc || null;
})(),
guestStatusCounts: {
READY_TO_SEND: 0, SENDING: 0, SENT: 0, SEND_ERROR: 0,
DELIVERY_ERROR: 0, INTERESTED: 0, MAYBE: 0, GOING: 0,
Expand Down Expand Up @@ -777,9 +784,16 @@ async function updateEvent(eventId, options) {
updateFields.push('location');
}

if (options.description) {
fields.description = { stringValue: stripMarkdown(options.description) };
updateFields.push('description');
if (options.description || options.link) {
let desc = stripMarkdown(options.description) || '';
if (options.link) {
const linkLabel = options.linkText || 'Link';
desc += (desc ? '\n\n' : '') + linkLabel + ': ' + options.link;
}
Comment on lines +788 to +792
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve existing description when applying --link

When partiful update <id> --link ... is used without --description, the new code builds desc from options.description only and then patches description with just the generated link text, so any existing event description is overwritten. This is a destructive regression for events that already have details, because adding a link now drops prior content instead of appending to it.

Useful? React with 👍 / 👎.

if (desc) {
fields.description = { stringValue: desc };
updateFields.push('description');
}
}

if (options.date) {
Expand All @@ -800,7 +814,7 @@ async function updateEvent(eventId, options) {
}

if (updateFields.length === 0) {
console.error('Error: No fields to update. Use --title, --location, --description, --date, --end-date, or --capacity');
console.error('Error: No fields to update. Use --title, --location, --description, --link, --date, --end-date, or --capacity');
process.exit(1);
}

Expand Down Expand Up @@ -1234,7 +1248,9 @@ Create Options:
--end-date "2026-04-01 10pm" End date/time (optional)
--location "Venue Name" Location name
--address "123 Main St" Street address
--description "Details" Event description
--description "Details" Event description
--link "https://..." Link to include in description
--link-text "Zoom Link" Label for the link (default: "Link")
--capacity 10 Guest limit
--waitlist Enable waitlist (default: true)
--private Make event private
Expand All @@ -1248,6 +1264,8 @@ Update Options:
--end-date "2026-04-01 11pm" Update end date/time
--location "New Venue" Update location
--description "New details" Update description
--link "https://..." Link to include in description
--link-text "Zoom Link" Label for the link (default: "Link")
--capacity 15 Update guest limit
--json Output full JSON response

Expand Down Expand Up @@ -1323,6 +1341,8 @@ async function main() {
location: args.location,
address: args.address,
description: args.description,
link: args.link,
linkText: args['link-text'],
capacity: args.capacity,
waitlist: args.waitlist,
private: args.private,
Expand Down Expand Up @@ -1357,6 +1377,8 @@ async function main() {
endDate: args['end-date'],
location: args.location,
description: args.description,
link: args.link,
linkText: args['link-text'],
capacity: args.capacity,
json: args.json
});
Expand Down