@fabriktor/fx 0.0.56 → 0.0.57

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.
@@ -8,6 +8,9 @@ export type EnsureChatRoomOptions = Parameters<ChatOperator["ensureChatRoom"]>[0
8
8
  export type MarkChatObjectsUploadedOptions = {
9
9
  id: ChatReplaceOptions["id"];
10
10
  };
11
+ export type ClearChatObjectsOptions = {
12
+ id: ChatReplaceOptions["id"];
13
+ };
11
14
  export type ReactChatOptions = Parameters<ChatOperator["reactChat"]>[0];
12
15
  export type ChatFXOptions = {
13
16
  chat: ChatOperator;
@@ -111,6 +114,7 @@ export interface ChatFXOperator {
111
114
  createChat(opts: CreateChatOptions): Promise<Chat>;
112
115
  ensureChatRoom(opts: EnsureChatRoomOptions): Promise<string>;
113
116
  markChatObjectsUploaded(opts: MarkChatObjectsUploadedOptions): Promise<Chat>;
117
+ clearChatObjects(opts: ClearChatObjectsOptions): Promise<Chat>;
114
118
  searchChats(opts: SearchChatsOptions): Promise<SearchChatsPage>;
115
119
  newLatestChatsCursor(opts: LatestChatsOptions): LatestChatsCursor;
116
120
  latestChats(opts: LatestChatsOptions): Promise<LatestChatsPage>;
@@ -131,6 +135,7 @@ export declare class ChatFX implements ChatFXOperator {
131
135
  createChat(opts: CreateChatOptions): Promise<Chat>;
132
136
  ensureChatRoom(opts: EnsureChatRoomOptions): Promise<string>;
133
137
  markChatObjectsUploaded(opts: MarkChatObjectsUploadedOptions): Promise<Chat>;
138
+ clearChatObjects(opts: ClearChatObjectsOptions): Promise<Chat>;
134
139
  searchChats(opts: SearchChatsOptions): Promise<SearchChatsPage>;
135
140
  newLatestChatsCursor(opts: LatestChatsOptions): LatestChatsCursor;
136
141
  latestChats(opts: LatestChatsOptions): Promise<LatestChatsPage>;
@@ -44,6 +44,16 @@ export class ChatFX {
44
44
  });
45
45
  return await this.findChat(opts.id);
46
46
  }
47
+ async clearChatObjects(opts) {
48
+ await this.chat.replaceOneChat({
49
+ id: opts.id,
50
+ in: {
51
+ has_objects: false,
52
+ objects_uploaded: false,
53
+ },
54
+ });
55
+ return await this.findChat(opts.id);
56
+ }
47
57
  async searchChats(opts) {
48
58
  const q = normalizeSearchQuery(opts.q);
49
59
  if (q === undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabriktor/fx",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "![Fabriktor Logo](./img/fabriktor-character.gif)",
5
5
  "type": "module",
6
6
  "exports": {