@remit/mailbox-service 0.0.107 → 0.0.108

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/mailbox-service",
3
- "version": "0.0.107",
3
+ "version": "0.0.108",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -150,6 +150,7 @@ class MemorySuggestions implements ICalendarSuggestionRepository {
150
150
  suggestionId,
151
151
  state: existing?.state ?? CalendarSuggestionState.Pending,
152
152
  acceptedCalendarObjectId: existing?.acceptedCalendarObjectId ?? "",
153
+ supersededByMessageId: existing?.supersededByMessageId ?? "",
153
154
  createdAt: existing?.createdAt ?? 1,
154
155
  updatedAt: 1,
155
156
  };
@@ -201,6 +202,7 @@ class MemorySuggestions implements ICalendarSuggestionRepository {
201
202
  async supersedeIfPending(
202
203
  _accountConfigId: string,
203
204
  suggestionId: string,
205
+ supersededByMessageId: string,
204
206
  ): Promise<CalendarSuggestionItem | null> {
205
207
  const row = this.rows.get(suggestionId);
206
208
  if (!row || row.state !== CalendarSuggestionState.Pending) return null;
@@ -208,10 +210,23 @@ class MemorySuggestions implements ICalendarSuggestionRepository {
208
210
  ...row,
209
211
  state: CalendarSuggestionState.Superseded,
210
212
  acceptedCalendarObjectId: "",
213
+ supersededByMessageId,
211
214
  };
212
215
  this.rows.set(suggestionId, retired);
213
216
  return retired;
214
217
  }
218
+
219
+ async repointSuperseded(
220
+ _accountConfigId: string,
221
+ suggestionId: string,
222
+ supersededByMessageId: string,
223
+ ): Promise<CalendarSuggestionItem | null> {
224
+ const row = this.rows.get(suggestionId);
225
+ if (!row || row.state !== CalendarSuggestionState.Superseded) return null;
226
+ const repointed = { ...row, supersededByMessageId };
227
+ this.rows.set(suggestionId, repointed);
228
+ return repointed;
229
+ }
215
230
  }
216
231
 
217
232
  interface Harness {