@fabriktor/fx 0.0.165 → 0.0.167

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.
@@ -1,9 +1,5 @@
1
1
  import type { CallsOperator, NotificationsOperator } from "@fabriktor/client";
2
- import type { Event } from "@fabriktor/schema";
3
- type EventInsertOptions = Parameters<CallsOperator["insertOneEvent"]>[0];
4
- type EventReplaceOptions = Parameters<CallsOperator["replaceOneEvent"]>[0];
5
- export type CreateEventOptions = EventInsertOptions;
6
- export type ReplaceEventOptions = EventReplaceOptions;
2
+ import { CallSession, type CallSessionOptions } from "./session.js";
7
3
  export type MintVideoTokenOptions = Parameters<CallsOperator["mintVideoToken"]>[0];
8
4
  export type RelayNotificationOptions = Parameters<NotificationsOperator["relayNotification"]>[0];
9
5
  export type StartCallOptions = {
@@ -22,8 +18,7 @@ export type CallsFXOptions = {
22
18
  notifications: NotificationsOperator;
23
19
  };
24
20
  export interface CallsFXOperator {
25
- createEvent(opts: CreateEventOptions): Promise<Event>;
26
- replaceEvent(opts: ReplaceEventOptions): Promise<Event>;
21
+ createSession(opts: CallSessionOptions): CallSession;
27
22
  startCall(opts: StartCallOptions): Promise<string>;
28
23
  answerCall(opts: AnswerCallOptions): Promise<string>;
29
24
  cancelCall(opts: CancelCallOptions): Promise<void>;
@@ -32,13 +27,10 @@ export declare class CallsFX implements CallsFXOperator {
32
27
  private calls;
33
28
  private notifications;
34
29
  constructor(opts: CallsFXOptions);
35
- createEvent(opts: CreateEventOptions): Promise<Event>;
36
- replaceEvent(opts: ReplaceEventOptions): Promise<Event>;
30
+ createSession(opts: CallSessionOptions): CallSession;
37
31
  startCall(opts: StartCallOptions): Promise<string>;
38
32
  answerCall(opts: AnswerCallOptions): Promise<string>;
39
33
  cancelCall(opts: CancelCallOptions): Promise<void>;
40
- private findEvent;
41
34
  private requireVideoToken;
42
35
  }
43
36
  export declare function newCallsFX(opts: CallsFXOptions): CallsFX;
44
- export {};
@@ -4,11 +4,8 @@
4
4
  // not use this file except in compliance with the License. You may obtain
5
5
  // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
6
  import { errResolveFailed } from "../core/err.js";
7
- import { requiredOperationID } from "../core/id.js";
8
- const resourceEvent = "event";
7
+ import { CallSession } from "./session.js";
9
8
  const resourceVideoToken = "video_token";
10
- const msgCreatedEventIDMissing = "Created event response did not contain an ID.";
11
- const msgEventMissing = "Event could not be resolved after the mutation.";
12
9
  const msgUnableToMintVideoToken = "Unable to mint video token.";
13
10
  export class CallsFX {
14
11
  calls;
@@ -17,14 +14,12 @@ export class CallsFX {
17
14
  this.calls = opts.calls;
18
15
  this.notifications = opts.notifications;
19
16
  }
20
- async createEvent(opts) {
21
- const out = await this.calls.insertOneEvent(opts);
22
- const id = requiredOperationID(out, msgCreatedEventIDMissing);
23
- return await this.findEvent(id);
24
- }
25
- async replaceEvent(opts) {
26
- await this.calls.replaceOneEvent(opts);
27
- return await this.findEvent(opts.id);
17
+ createSession(opts) {
18
+ return new CallSession({
19
+ ...opts,
20
+ mint: (mint) => this.requireVideoToken(mint),
21
+ notifications: this.notifications,
22
+ });
28
23
  }
29
24
  async startCall(opts) {
30
25
  const token = await this.requireVideoToken(opts.mint);
@@ -39,19 +34,6 @@ export class CallsFX {
39
34
  async cancelCall(opts) {
40
35
  await this.notifications.relayNotification(opts.notification);
41
36
  }
42
- async findEvent(id) {
43
- const out = await this.calls.findOneEvent({
44
- id,
45
- });
46
- const event = out.value;
47
- if (event === undefined) {
48
- throw errResolveFailed({
49
- resource: resourceEvent,
50
- msg: msgEventMissing,
51
- });
52
- }
53
- return event;
54
- }
55
37
  async requireVideoToken(opts) {
56
38
  const out = await this.calls.mintVideoToken(opts);
57
39
  const token = out.value?.trim();
@@ -0,0 +1,84 @@
1
+ import type { CallsOperator, NotificationsOperator } from "@fabriktor/client";
2
+ import { CallModeAudio, CallModeVideo } from "@fabriktor/schema";
3
+ export declare const callsNotificationKey = "calls.events.received";
4
+ export declare const callRingTimeoutMS = 60000;
5
+ export type CallMode = typeof CallModeAudio | typeof CallModeVideo;
6
+ export type CallPhase = "idle" | "incoming" | "connecting" | "ringing" | "connected" | "reconnecting";
7
+ export type CallParticipant = {
8
+ id: string;
9
+ user_id: string;
10
+ local: boolean;
11
+ audio: boolean;
12
+ video: boolean;
13
+ };
14
+ export type CallMediaState = {
15
+ participants: readonly CallParticipant[];
16
+ reconnecting: boolean;
17
+ };
18
+ export interface CallMediaConnection {
19
+ disconnect(): void;
20
+ microphone(enabled: boolean): Promise<void>;
21
+ camera(enabled: boolean): Promise<void>;
22
+ }
23
+ export interface CallMediaAdapter {
24
+ connect(opts: {
25
+ token: string;
26
+ room_id: string;
27
+ video: boolean;
28
+ signal: AbortSignal;
29
+ on_change: (state: CallMediaState) => void;
30
+ on_disconnect: (error?: unknown) => void;
31
+ }): Promise<CallMediaConnection>;
32
+ }
33
+ export type CallInvitation = {
34
+ id: string;
35
+ room_id: string;
36
+ caller_id: string;
37
+ mode: CallMode;
38
+ };
39
+ export type CallSessionState = {
40
+ phase: CallPhase;
41
+ call: CallInvitation | null;
42
+ participants: readonly CallParticipant[];
43
+ microphone: boolean;
44
+ camera: boolean;
45
+ };
46
+ export type CallSessionOptions = {
47
+ owner_id: string;
48
+ media: CallMediaAdapter;
49
+ on_change: (state: CallSessionState) => void;
50
+ on_error: (error: unknown) => void;
51
+ };
52
+ export type CallSessionDependencies = CallSessionOptions & {
53
+ mint: (opts: Parameters<CallsOperator["mintVideoToken"]>[0]) => Promise<string>;
54
+ notifications: NotificationsOperator;
55
+ };
56
+ export declare class CallSession {
57
+ private opts;
58
+ state: CallSessionState;
59
+ private connection?;
60
+ private controller?;
61
+ private timer?;
62
+ private recipients;
63
+ private closed;
64
+ private had_remote;
65
+ private disposed;
66
+ private inviting?;
67
+ constructor(opts: CallSessionDependencies);
68
+ start(room_id: string, members: readonly string[], mode: CallMode): Promise<void>;
69
+ receive(data: Readonly<Record<string, string>>): void;
70
+ answer(): Promise<void>;
71
+ end(): Promise<void>;
72
+ microphone(enabled: boolean): Promise<void>;
73
+ camera(enabled: boolean): Promise<void>;
74
+ dispose(): void;
75
+ private begin;
76
+ private connect;
77
+ private relay;
78
+ private current;
79
+ private publish;
80
+ private reset;
81
+ private remember;
82
+ private armTimeout;
83
+ private clearTimer;
84
+ }
@@ -0,0 +1,309 @@
1
+ // Copyright (C) Fabriktor, Inc. 2025-present.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+ // not use this file except in compliance with the License. You may obtain
5
+ // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ import { CallIDKey, CallRoomIDKey, CallSenderIDKey, CallModeKey, CallSignalKey, CallModeAudio, CallModeVideo, CallSignalInvite, CallSignalAnswered, CallSignalCancelled, ColCallsEvents, SvcCalls, } from "@fabriktor/schema";
7
+ import { errValidation } from "../core/err.js";
8
+ // Notification keys are preference-map keys, not generated Go constants.
9
+ export const callsNotificationKey = `${SvcCalls}.${ColCallsEvents}.received`;
10
+ export const callRingTimeoutMS = 60_000;
11
+ const closedCallLimit = 100;
12
+ const callNotificationTitle = "Fabriktor call";
13
+ const callNotificationBody = "Open Fabriktor to join the call.";
14
+ function idleCallState() {
15
+ return {
16
+ phase: "idle",
17
+ call: null,
18
+ participants: [],
19
+ microphone: true,
20
+ camera: false,
21
+ };
22
+ }
23
+ // One foreground call per authenticated session. Media ownership is independent of views.
24
+ export class CallSession {
25
+ opts;
26
+ state = idleCallState();
27
+ connection;
28
+ controller;
29
+ timer;
30
+ recipients = [];
31
+ closed = new Set();
32
+ had_remote = false;
33
+ disposed = false;
34
+ inviting;
35
+ constructor(opts) {
36
+ this.opts = opts;
37
+ }
38
+ async start(room_id, members, mode) {
39
+ if (this.disposed || this.state.call)
40
+ return;
41
+ const recipients = [...new Set(members)].filter((id) => id && id !== this.opts.owner_id);
42
+ if (!room_id || !recipients.length)
43
+ throw errValidation({
44
+ msg: "A call requires a room and another member.",
45
+ });
46
+ const call = {
47
+ id: crypto.randomUUID(),
48
+ room_id,
49
+ caller_id: this.opts.owner_id,
50
+ mode,
51
+ };
52
+ this.recipients = recipients;
53
+ this.begin(call, "connecting");
54
+ try {
55
+ await this.connect(call);
56
+ if (!this.current(call))
57
+ return;
58
+ // Do not ring recipients until the caller has joined successfully.
59
+ const inviting = this.relay(call, CallSignalInvite, recipients);
60
+ this.inviting = { id: call.id, promise: inviting };
61
+ await inviting;
62
+ if (!this.current(call))
63
+ return;
64
+ if (!this.had_remote)
65
+ this.publish({ phase: "ringing" });
66
+ this.armTimeout(call);
67
+ }
68
+ catch (error) {
69
+ if (this.current(call)) {
70
+ this.reset(call);
71
+ throw error;
72
+ }
73
+ }
74
+ finally {
75
+ if (this.inviting?.id === call.id)
76
+ this.inviting = undefined;
77
+ }
78
+ }
79
+ receive(data) {
80
+ if (this.disposed)
81
+ return;
82
+ const id = data[CallIDKey], room_id = data[CallRoomIDKey], sender = data[CallSenderIDKey];
83
+ const mode = data[CallModeKey], signal = data[CallSignalKey];
84
+ if (!id ||
85
+ !room_id ||
86
+ !sender ||
87
+ (mode !== CallModeAudio && mode !== CallModeVideo))
88
+ return;
89
+ const call = this.state.call;
90
+ if (signal === CallSignalInvite) {
91
+ if (sender === this.opts.owner_id ||
92
+ this.closed.has(id) ||
93
+ call?.id === id)
94
+ return;
95
+ const incoming = { id, room_id, caller_id: sender, mode };
96
+ if (call) {
97
+ // Busy/decline affects this recipient only, never an entire group.
98
+ this.remember(id);
99
+ void this.relay(incoming, CallSignalCancelled, [
100
+ sender,
101
+ this.opts.owner_id,
102
+ ]).catch(this.opts.on_error);
103
+ return;
104
+ }
105
+ this.begin(incoming, "incoming");
106
+ this.armTimeout(incoming);
107
+ return;
108
+ }
109
+ if (signal !== CallSignalCancelled && signal !== CallSignalAnswered)
110
+ return;
111
+ if (!call || call.id !== id || call.room_id !== room_id) {
112
+ this.remember(id);
113
+ return;
114
+ }
115
+ if (sender === this.opts.owner_id) {
116
+ // The accepting device is already connecting; other devices still ring.
117
+ if (this.state.phase === "incoming")
118
+ this.reset(call);
119
+ return;
120
+ }
121
+ if (signal !== CallSignalCancelled)
122
+ return;
123
+ if (sender === call.caller_id &&
124
+ (this.state.phase === "incoming" || this.state.phase === "connecting")) {
125
+ this.reset(call);
126
+ }
127
+ else if (call.caller_id === this.opts.owner_id && !this.had_remote) {
128
+ this.recipients = this.recipients.filter((id) => id !== sender);
129
+ if (!this.recipients.length)
130
+ this.reset(call);
131
+ }
132
+ }
133
+ async answer() {
134
+ const call = this.state.call;
135
+ if (!call || this.state.phase !== "incoming")
136
+ return;
137
+ this.clearTimer();
138
+ this.publish({ phase: "connecting" });
139
+ try {
140
+ await this.connect(call);
141
+ if (!this.current(call))
142
+ return;
143
+ await this.relay(call, CallSignalAnswered, [this.opts.owner_id]);
144
+ if (this.current(call)) {
145
+ this.publish({ phase: this.had_remote ? "connected" : "connecting" });
146
+ this.armTimeout(call);
147
+ }
148
+ }
149
+ catch (error) {
150
+ if (this.current(call)) {
151
+ this.reset(call);
152
+ throw error;
153
+ }
154
+ }
155
+ }
156
+ async end() {
157
+ const call = this.state.call;
158
+ if (!call)
159
+ return;
160
+ const recipients = call.caller_id === this.opts.owner_id
161
+ ? [...this.recipients]
162
+ : this.state.phase === "incoming" || this.state.phase === "connecting"
163
+ ? [call.caller_id, this.opts.owner_id]
164
+ : [this.opts.owner_id];
165
+ const inviting = this.inviting?.id === call.id ? this.inviting.promise : undefined;
166
+ // Release devices immediately, including a pending permission/connect request.
167
+ this.reset(call);
168
+ if (inviting)
169
+ await inviting.catch(() => { });
170
+ if (!this.disposed && recipients.length)
171
+ await this.relay(call, CallSignalCancelled, recipients);
172
+ }
173
+ async microphone(enabled) {
174
+ const connection = this.connection;
175
+ if (!connection)
176
+ return;
177
+ await connection.microphone(enabled);
178
+ if (connection === this.connection)
179
+ this.publish({ microphone: enabled });
180
+ }
181
+ async camera(enabled) {
182
+ const connection = this.connection;
183
+ if (!connection || this.state.call?.mode !== CallModeVideo)
184
+ return;
185
+ await connection.camera(enabled);
186
+ if (connection === this.connection)
187
+ this.publish({ camera: enabled });
188
+ }
189
+ dispose() {
190
+ this.disposed = true;
191
+ if (this.state.call)
192
+ this.reset(this.state.call);
193
+ this.closed.clear();
194
+ }
195
+ begin(call, phase) {
196
+ this.controller = new AbortController();
197
+ this.had_remote = false;
198
+ this.state = {
199
+ ...idleCallState(),
200
+ call,
201
+ phase,
202
+ camera: call.mode === CallModeVideo,
203
+ };
204
+ this.opts.on_change(this.state);
205
+ }
206
+ async connect(call) {
207
+ const signal = this.controller.signal;
208
+ const token = await this.opts.mint({ room_id: call.room_id });
209
+ if (!this.current(call))
210
+ return;
211
+ const connection = await this.opts.media.connect({
212
+ token,
213
+ room_id: call.room_id,
214
+ video: call.mode === CallModeVideo,
215
+ signal,
216
+ on_change: (state) => {
217
+ if (!this.current(call))
218
+ return;
219
+ const remote = state.participants.some((participant) => !participant.local);
220
+ if (remote) {
221
+ this.had_remote = true;
222
+ this.clearTimer();
223
+ }
224
+ else if (this.had_remote && !state.reconnecting) {
225
+ void this.end().catch(this.opts.on_error);
226
+ return;
227
+ }
228
+ const local = state.participants.find((participant) => participant.local);
229
+ this.publish({
230
+ participants: state.participants,
231
+ ...(local ? { microphone: local.audio, camera: local.video } : {}),
232
+ phase: state.reconnecting
233
+ ? "reconnecting"
234
+ : this.had_remote
235
+ ? "connected"
236
+ : this.state.phase,
237
+ });
238
+ },
239
+ on_disconnect: (error) => {
240
+ if (!this.current(call))
241
+ return;
242
+ void this.end().catch(this.opts.on_error);
243
+ if (error)
244
+ this.opts.on_error(error);
245
+ },
246
+ });
247
+ if (!this.current(call))
248
+ connection.disconnect();
249
+ else
250
+ this.connection = connection;
251
+ }
252
+ relay(call, signal, user_ids) {
253
+ return this.opts.notifications.relayNotification({
254
+ user_ids,
255
+ notif_k: callsNotificationKey,
256
+ // The relay owns and translates notification wording.
257
+ english_title: callNotificationTitle,
258
+ english_body: callNotificationBody,
259
+ path_custom_image: "",
260
+ url_custom_sound: "",
261
+ custom_data: {
262
+ [CallIDKey]: call.id,
263
+ [CallRoomIDKey]: call.room_id,
264
+ [CallModeKey]: call.mode,
265
+ [CallSignalKey]: signal,
266
+ },
267
+ });
268
+ }
269
+ current(call) {
270
+ return (!this.disposed &&
271
+ this.state.call === call &&
272
+ !this.controller?.signal.aborted);
273
+ }
274
+ publish(patch) {
275
+ this.state = { ...this.state, ...patch };
276
+ this.opts.on_change(this.state);
277
+ }
278
+ reset(call) {
279
+ this.remember(call.id);
280
+ this.clearTimer();
281
+ this.state = idleCallState();
282
+ this.controller?.abort();
283
+ this.controller = undefined;
284
+ const connection = this.connection;
285
+ this.connection = undefined;
286
+ connection?.disconnect();
287
+ this.recipients = [];
288
+ this.opts.on_change(this.state);
289
+ }
290
+ remember(id) {
291
+ this.closed.add(id);
292
+ if (this.closed.size > closedCallLimit)
293
+ this.closed.delete(this.closed.values().next().value);
294
+ }
295
+ armTimeout(call) {
296
+ this.clearTimer();
297
+ if (this.had_remote)
298
+ return;
299
+ this.timer = setTimeout(() => {
300
+ if (this.current(call))
301
+ void this.end().catch(this.opts.on_error);
302
+ }, callRingTimeoutMS);
303
+ }
304
+ clearTimer() {
305
+ if (this.timer)
306
+ clearTimeout(this.timer);
307
+ this.timer = undefined;
308
+ }
309
+ }
@@ -11,6 +11,7 @@ import { type SaveFeedPostOptions, type FeedPostSaveResult, type FeedPostSaveSta
11
11
  export declare const FeedEvents: {
12
12
  Changed: import("../index.js").EventKey<{
13
13
  post_id: string;
14
+ deleted?: boolean;
14
15
  }>;
15
16
  };
16
17
  export type FeedReadOptions = {
@@ -16,7 +16,9 @@ import { prepareFeedTextPost, validateFeedVisibility, feedPostInput, checkFeedPo
16
16
  export * from "./validation.js";
17
17
  export * from "./media.js";
18
18
  import { saveFeedPost, newFeedPostSaveState, } from "./media.js";
19
- export const FeedEvents = { Changed: createEvent() };
19
+ export const FeedEvents = {
20
+ Changed: createEvent(),
21
+ };
20
22
  const newFeedSessionToken = "";
21
23
  const resourceFeedSessionToken = "feed_session_token";
22
24
  const resourceFeedPost = "feed_post";
@@ -252,7 +254,7 @@ export class FeedFX {
252
254
  });
253
255
  await this.feed.deleteOneFeedPost({ id: current.id, signal });
254
256
  signal.throwIfAborted();
255
- this.changed(current.id);
257
+ this.changed(current.id, true);
256
258
  if (resolvedID(current.reply_to_post_id))
257
259
  this.changed(current.reply_to_post_id);
258
260
  if (resolvedID(current.referenced_post_id))
@@ -276,8 +278,8 @@ export class FeedFX {
276
278
  });
277
279
  return post;
278
280
  }
279
- changed(post_id) {
280
- this.events.publish(FeedEvents.Changed, { post_id });
281
+ changed(post_id, deleted = false) {
282
+ this.events.publish(FeedEvents.Changed, { post_id, deleted });
281
283
  }
282
284
  async mutate(fn, parent) {
283
285
  const signal = this.sessions.signal(parent);
@@ -519,6 +521,7 @@ export class FeedFX {
519
521
  id,
520
522
  });
521
523
  signal.throwIfAborted();
524
+ this.changed(id, true);
522
525
  this.markActionRemoved(post_id, FeedAction.Reply);
523
526
  return out;
524
527
  });
@@ -560,6 +563,7 @@ export class FeedFX {
560
563
  id,
561
564
  });
562
565
  signal.throwIfAborted();
566
+ this.changed(id, true);
563
567
  this.markActionRemoved(post_id, FeedAction.Reference);
564
568
  return out;
565
569
  });
@@ -1,6 +1,7 @@
1
1
  export * from "./auth/auth.js";
2
2
  export * from "./billable/billable.js";
3
3
  export * from "./calls/calls.js";
4
+ export * from "./calls/session.js";
4
5
  export * from "./chat/chat.js";
5
6
  export * from "./chat/data.js";
6
7
  export * from "./chat/forms.js";
package/dist/src/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from "./auth/auth.js";
2
2
  export * from "./billable/billable.js";
3
3
  export * from "./calls/calls.js";
4
+ export * from "./calls/session.js";
4
5
  export * from "./chat/chat.js";
5
6
  export * from "./chat/data.js";
6
7
  export * from "./chat/forms.js";
@@ -6,15 +6,21 @@ export type NotificationsFXOptions = {
6
6
  };
7
7
  export type SyncDeviceTokenOptions = {
8
8
  owner_id: string;
9
+ previous_id?: string;
10
+ };
11
+ export type UnregisterDeviceTokenOptions = {
12
+ id: string;
9
13
  };
10
14
  export type SyncDeviceTokenResult = Awaited<ReturnType<NotificationsOperator["upsertOneDTok"]>>;
11
15
  export interface NotificationsFXOperator {
12
16
  syncDeviceToken(opts: SyncDeviceTokenOptions): Promise<SyncDeviceTokenResult>;
17
+ unregisterDeviceToken(opts: UnregisterDeviceTokenOptions): Promise<void>;
13
18
  }
14
19
  export declare class NotificationsFX implements NotificationsFXOperator {
15
20
  private notifications;
16
21
  private getDeviceToken;
17
22
  constructor(opts: NotificationsFXOptions);
18
23
  syncDeviceToken(opts: SyncDeviceTokenOptions): Promise<SyncDeviceTokenResult>;
24
+ unregisterDeviceToken(opts: UnregisterDeviceTokenOptions): Promise<void>;
19
25
  }
20
26
  export declare function newNotificationsFX(opts: NotificationsFXOptions): NotificationsFX;
@@ -5,8 +5,11 @@
5
5
  // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
6
  import { ZeroID } from "@fabriktor/schema";
7
7
  import { errRequired } from "../core/err.js";
8
+ import { requiredOperationID, resolvedID } from "../core/id.js";
8
9
  const msgOwnerIDRequired = "Owner ID is required.";
9
10
  const msgDeviceTokenRequired = "Device token is required.";
11
+ const msgDeviceRegistrationRequired = "Device registration is required.";
12
+ const msgDeviceRegistrationMissing = "Device registration response did not contain an ID.";
10
13
  export class NotificationsFX {
11
14
  notifications;
12
15
  getDeviceToken;
@@ -37,7 +40,23 @@ export class NotificationsFX {
37
40
  owner_id,
38
41
  },
39
42
  };
40
- return await this.notifications.upsertOneDTok(input);
43
+ const out = await this.notifications.upsertOneDTok(input);
44
+ const id = requiredOperationID(out, msgDeviceRegistrationMissing);
45
+ const previousID = resolvedID(opts.previous_id);
46
+ if (previousID !== undefined && previousID !== id) {
47
+ await this.notifications.deleteOneDTok({ id: previousID });
48
+ }
49
+ return out;
50
+ }
51
+ async unregisterDeviceToken(opts) {
52
+ const id = resolvedID(opts.id);
53
+ if (id === undefined) {
54
+ throw errRequired({
55
+ field: "id",
56
+ msg: msgDeviceRegistrationRequired,
57
+ });
58
+ }
59
+ await this.notifications.deleteOneDTok({ id });
41
60
  }
42
61
  }
43
62
  export function newNotificationsFX(opts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabriktor/fx",
3
- "version": "0.0.165",
3
+ "version": "0.0.167",
4
4
  "description": "![Fabriktor Logo](./img/fabriktor-character.gif)",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,9 +17,9 @@
17
17
  "typescript": "^6.0.3"
18
18
  },
19
19
  "dependencies": {
20
- "@fabriktor/client": "0.0.101",
20
+ "@fabriktor/client": "0.0.102",
21
21
  "@fabriktor/fx": "0.0.94",
22
- "@fabriktor/schema": "0.0.73",
22
+ "@fabriktor/schema": "0.0.74",
23
23
  "convert": "8.0.2"
24
24
  }
25
25
  }