exponential-cli 1.13.0 → 1.14.0

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/README.md CHANGED
@@ -194,6 +194,13 @@ cat transcript.txt | exponential meetings create -t "Standup" --transcript-file
194
194
  # Update — only the fields you pass are written
195
195
  exponential meetings update --id <cuid> -t "Renamed" --summary "Recap ..."
196
196
 
197
+ # Permanently delete meetings you own. More than one id requires --force; ids that
198
+ # aren't yours are skipped and reported (and the exit code is non-zero).
199
+ exponential meetings delete <cuid>
200
+ exponential meetings delete --force <cuid> <cuid> <cuid>
201
+ # DANGER: deletes every meeting the filter matches — permanently. Filter deliberately.
202
+ exponential meetings list --mine --archived | jq -r '.meetings[] | select(.archivedAt != null) | .id' | exponential meetings delete --force --ids-file -
203
+
197
204
  # Meeting notes: read raw Markdown (safe to redirect), replace, or append a block
198
205
  exponential meetings notes get <cuid> > notes.md # --json for a {id, notes} envelope
199
206
  exponential meetings notes set <cuid> --file notes.md # or inline, or --file - for stdin
package/dist/index.js CHANGED
@@ -4094,6 +4094,71 @@ function createMeetingsCommand() {
4094
4094
  }
4095
4095
  }
4096
4096
  );
4097
+ meetings.command("delete [ids...]").description(
4098
+ 'Permanently delete meetings you own. Pass one or more ids, and/or --ids-file with whitespace-separated ids ("-" = stdin). Deleting more than one id requires --force. Exit 0 only when everything requested was deleted.'
4099
+ ).option("--ids-file <path>", 'Read whitespace-separated meeting ids from a file ("-" = stdin)').option("--force", "Confirm deleting more than one meeting in a single call").action(
4100
+ async (idArgs, options, cmd) => {
4101
+ const globalOpts = cmd.optsWithGlobals();
4102
+ const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);
4103
+ try {
4104
+ const fromFile = readText(void 0, options.idsFile);
4105
+ const ids = [
4106
+ ...new Set([
4107
+ ...idArgs,
4108
+ ...fromFile ? fromFile.split(/\s+/) : []
4109
+ ].filter((id) => id !== ""))
4110
+ ];
4111
+ if (ids.length === 0) {
4112
+ throw new Error(
4113
+ "Nothing to delete. Pass one or more meeting ids, or --ids-file <path|->."
4114
+ );
4115
+ }
4116
+ const malformed = ids.filter((id) => !/^[a-z][a-z0-9]{15,}$/i.test(id));
4117
+ if (malformed.length > 0) {
4118
+ throw new Error(
4119
+ `These don't look like meeting ids: ${malformed.slice(0, 5).join(", ")}${malformed.length > 5 ? ` (+${malformed.length - 5} more)` : ""}. Nothing was deleted.`
4120
+ );
4121
+ }
4122
+ if (ids.length > 1 && !options.force) {
4123
+ throw new Error(
4124
+ `Refusing to delete ${ids.length} meetings without --force. Deletion is permanent.`
4125
+ );
4126
+ }
4127
+ const client = getClient();
4128
+ let count;
4129
+ if (ids.length === 1) {
4130
+ await client.meetings.delete(ids[0]);
4131
+ count = 1;
4132
+ } else {
4133
+ count = 0;
4134
+ for (let i = 0; i < ids.length; i += 500) {
4135
+ const chunk = ids.slice(i, i + 500);
4136
+ count += (await client.meetings.deleteMany(chunk)).count;
4137
+ }
4138
+ }
4139
+ const skipped = ids.length - count;
4140
+ if (skipped > 0) {
4141
+ process.exitCode = 1;
4142
+ }
4143
+ if (useJson) {
4144
+ console.log(
4145
+ JSON.stringify({ requested: ids.length, count, skipped }, null, 2)
4146
+ );
4147
+ } else {
4148
+ console.log(`\u2713 Deleted ${count} of ${ids.length} meeting${ids.length === 1 ? "" : "s"}`);
4149
+ if (skipped > 0) {
4150
+ console.log(
4151
+ chalk6.yellow(
4152
+ `${skipped} id(s) were skipped \u2014 not found, or not owned by you.`
4153
+ )
4154
+ );
4155
+ }
4156
+ }
4157
+ } catch (error) {
4158
+ handleError(error, useJson);
4159
+ }
4160
+ }
4161
+ );
4097
4162
  const notes = new Command13("notes").description(
4098
4163
  "Read and write a meeting's notes"
4099
4164
  );