@burdenoff/microfe-channel 2026.513.2 → 2026.514.2

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.
Files changed (32) hide show
  1. package/dist/channel/ChannelRoot.js +1 -1
  2. package/dist/channel/ChannelRoot.js.map +1 -1
  3. package/dist/channel/hooks/useChannelSubscription.d.ts +4 -4
  4. package/dist/channel/hooks/useChannelSubscription.d.ts.map +1 -1
  5. package/dist/channel/hooks/useChannelSubscription.js +2 -2
  6. package/dist/channel/hooks/useChannelSubscription.js.map +1 -1
  7. package/dist/channel/hooks/useChannels.d.ts.map +1 -1
  8. package/dist/channel/hooks/useChannels.js +130 -124
  9. package/dist/channel/hooks/useChannels.js.map +1 -1
  10. package/dist/channel/modules/channels/pages/ChannelSettingsPage.js +5 -5
  11. package/dist/channel/modules/channels/pages/ChannelSettingsPage.js.map +1 -1
  12. package/dist/channel/modules/channels/pages/ChannelUsersPage.d.ts.map +1 -1
  13. package/dist/channel/modules/channels/pages/ChannelUsersPage.js +25 -7
  14. package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
  15. package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +7 -7
  16. package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
  17. package/dist/channel/modules/channels/pages/ConnectionsListPage.d.ts.map +1 -1
  18. package/dist/channel/modules/channels/pages/ConnectionsListPage.js +137 -133
  19. package/dist/channel/modules/channels/pages/ConnectionsListPage.js.map +1 -1
  20. package/dist/channel/modules/channels/pages/DeliveryHistoryPage.d.ts.map +1 -1
  21. package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js +162 -158
  22. package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js.map +1 -1
  23. package/dist/channel/modules/channels/pages/EditChannelPage.js +5 -5
  24. package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
  25. package/dist/channel/modules/channels/pages/SendMessagePage.js +2 -2
  26. package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
  27. package/dist/channel/modules/channels/pages/WebhookEventsPage.d.ts.map +1 -1
  28. package/dist/channel/modules/channels/pages/WebhookEventsPage.js +11 -3
  29. package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
  30. package/dist/translations/en.d.ts +260 -0
  31. package/dist/translations/en.d.ts.map +1 -0
  32. package/package.json +3 -1
@@ -1,22 +1,28 @@
1
1
  import { useChannel as e } from "../providers/ChannelProvider.js";
2
- import { emitShellEvent as t } from "../utils/shellBridge.js";
3
- import { getGlobalChannelClient as n } from "../graphql/global-client.js";
4
- import { ActivateChannelDocument as r, CreateChannelDocument as i, CreateConnectionDocument as a, DeactivateChannelDocument as o, DeleteChannelDocument as s, DeleteConnectionDocument as c, DeliverNotificationDocument as l, GetChannelDocument as u, GetChannelsDocument as d, GetDeliveryAttemptsDocument as f, GetDeliveryStatsDocument as p, GetUserPlatformConnectionsDocument as m, GetWebhookEventsDocument as h, RetryDeliveryDocument as g, RunChannelHealthCheckDocument as _, TestConnectionHealthDocument as v, UpdateChannelDocument as y, UpdateConnectionDocument as b } from "../../generated/global-operations.js";
5
- import { useCallback as x, useEffect as S, useState as C } from "react";
2
+ import { emitShellEvent as t, reportShellError as n } from "../utils/shellBridge.js";
3
+ import { getGlobalChannelClient as r } from "../graphql/global-client.js";
4
+ import { ActivateChannelDocument as i, CreateChannelDocument as a, CreateConnectionDocument as o, DeactivateChannelDocument as s, DeleteChannelDocument as c, DeleteConnectionDocument as l, DeliverNotificationDocument as u, GetChannelDocument as d, GetChannelsDocument as f, GetDeliveryAttemptsDocument as p, GetDeliveryStatsDocument as m, GetUserPlatformConnectionsDocument as h, GetWebhookEventsDocument as g, RetryDeliveryDocument as _, RunChannelHealthCheckDocument as v, TestConnectionHealthDocument as y, UpdateChannelDocument as b, UpdateConnectionDocument as x } from "../../generated/global-operations.js";
5
+ import { useCallback as S, useEffect as C, useState as w } from "react";
6
6
  //#region src/channel/hooks/useChannels.ts
7
- function w(e, t, n = {}) {
8
- console.error(`[channel] ${t}`, e, n);
7
+ function T(e, t, r = {}) {
8
+ n(e, {
9
+ module: "channel",
10
+ context: {
11
+ action: t,
12
+ ...r
13
+ }
14
+ });
9
15
  }
10
- function T(a) {
11
- let { authToken: c, apiGatewayUrl: u, organizationId: f } = e(), [p, m] = C([]), [h, g] = C(!0), [v, b] = C(null), [T, E] = C(!1), [D, O] = C(0), [k, A] = C(a ?? {}), j = x(() => n(u, c, f), [
12
- u,
13
- c,
14
- f
15
- ]), M = x(async (e) => {
16
- g(!0), b(null);
16
+ function E(n) {
17
+ let { authToken: o, apiGatewayUrl: l, organizationId: d } = e(), [p, m] = w([]), [h, g] = w(!0), [_, y] = w(null), [x, E] = w(!1), [D, O] = w(0), [k, A] = w(n ?? {}), j = S(() => r(l, o, d), [
18
+ l,
19
+ o,
20
+ d
21
+ ]), M = S(async (e) => {
22
+ g(!0), y(null);
17
23
  try {
18
24
  let t = (await j().query({
19
- query: d,
25
+ query: f,
20
26
  variables: {
21
27
  filter: k,
22
28
  pagination: e ?? {
@@ -29,25 +35,25 @@ function T(a) {
29
35
  t && (m(t.items), O(t.total), E(t.hasMore));
30
36
  } catch (e) {
31
37
  let t = e instanceof Error ? e.message : "Failed to fetch channels";
32
- w(e, "Failed to fetch channels"), b(t);
38
+ T(e, "Failed to fetch channels"), y(t);
33
39
  } finally {
34
40
  g(!1);
35
41
  }
36
42
  }, [j, k]);
37
- return S(() => {
43
+ return C(() => {
38
44
  Promise.resolve().then(() => M());
39
45
  }, [M]), {
40
46
  channels: p,
41
47
  isLoading: h,
42
- error: v,
43
- hasMore: T,
48
+ error: _,
49
+ hasMore: x,
44
50
  total: D,
45
51
  filter: k,
46
52
  refetch: M,
47
- createChannel: x(async (e) => {
53
+ createChannel: S(async (e) => {
48
54
  try {
49
55
  let n = (await j().mutate({
50
- mutation: i,
56
+ mutation: a,
51
57
  variables: { input: e }
52
58
  })).data?.createChannel ?? null;
53
59
  return n && t("channel.created", {
@@ -56,13 +62,13 @@ function T(a) {
56
62
  }), await M(), n;
57
63
  } catch (e) {
58
64
  let t = e instanceof Error ? e.message : "Failed to create channel";
59
- return w(e, "Failed to create channel"), b(t), null;
65
+ return T(e, "Failed to create channel"), y(t), null;
60
66
  }
61
67
  }, [j, M]),
62
- updateChannel: x(async (e, n) => {
68
+ updateChannel: S(async (e, n) => {
63
69
  try {
64
70
  let r = await j().mutate({
65
- mutation: y,
71
+ mutation: b,
66
72
  variables: {
67
73
  id: e,
68
74
  input: n
@@ -71,24 +77,24 @@ function T(a) {
71
77
  return t("channel.updated", { id: e }), await M(), r.data?.updateChannel ?? null;
72
78
  } catch (e) {
73
79
  let t = e instanceof Error ? e.message : "Failed to update channel";
74
- return w(e, "Failed to update channel"), b(t), null;
80
+ return T(e, "Failed to update channel"), y(t), null;
75
81
  }
76
82
  }, [j, M]),
77
- deleteChannel: x(async (e) => {
83
+ deleteChannel: S(async (e) => {
78
84
  try {
79
85
  return await j().mutate({
80
- mutation: s,
86
+ mutation: c,
81
87
  variables: { id: e }
82
88
  }), t("channel.deleted", { id: e }), await M(), !0;
83
89
  } catch (e) {
84
90
  let t = e instanceof Error ? e.message : "Failed to delete channel";
85
- return w(e, "Failed to delete channel"), b(t), !1;
91
+ return T(e, "Failed to delete channel"), y(t), !1;
86
92
  }
87
93
  }, [j, M]),
88
- activateChannel: x(async (e) => {
94
+ activateChannel: S(async (e) => {
89
95
  try {
90
96
  return await j().mutate({
91
- mutation: r,
97
+ mutation: i,
92
98
  variables: { id: e }
93
99
  }), t("channel.updated", {
94
100
  id: e,
@@ -96,13 +102,13 @@ function T(a) {
96
102
  }), await M(), !0;
97
103
  } catch (e) {
98
104
  let t = e instanceof Error ? e.message : "Failed to activate channel";
99
- return w(e, "Failed to activate channel"), b(t), !1;
105
+ return T(e, "Failed to activate channel"), y(t), !1;
100
106
  }
101
107
  }, [j, M]),
102
- deactivateChannel: x(async (e) => {
108
+ deactivateChannel: S(async (e) => {
103
109
  try {
104
110
  return await j().mutate({
105
- mutation: o,
111
+ mutation: s,
106
112
  variables: { id: e }
107
113
  }), t("channel.updated", {
108
114
  id: e,
@@ -110,34 +116,34 @@ function T(a) {
110
116
  }), await M(), !0;
111
117
  } catch (e) {
112
118
  let t = e instanceof Error ? e.message : "Failed to deactivate channel";
113
- return w(e, "Failed to deactivate channel"), b(t), !1;
119
+ return T(e, "Failed to deactivate channel"), y(t), !1;
114
120
  }
115
121
  }, [j, M]),
116
- runHealthCheck: x(async (e) => {
122
+ runHealthCheck: S(async (e) => {
117
123
  try {
118
124
  let t = await j().mutate({
119
- mutation: _,
125
+ mutation: v,
120
126
  variables: { id: e }
121
127
  });
122
128
  return await M(), t.data?.runChannelHealthCheck ?? null;
123
129
  } catch (e) {
124
130
  let t = e instanceof Error ? e.message : "Failed to run health check";
125
- return w(e, "Failed to run health check"), b(t), null;
131
+ return T(e, "Failed to run health check"), y(t), null;
126
132
  }
127
133
  }, [j, M]),
128
- updateFilter: x((e) => {
134
+ updateFilter: S((e) => {
129
135
  A((t) => ({
130
136
  ...t,
131
137
  ...e
132
138
  }));
133
139
  }, []),
134
- resetFilter: x(() => {
140
+ resetFilter: S(() => {
135
141
  A({});
136
142
  }, []),
137
- deliverNotification: x(async (e) => {
143
+ deliverNotification: S(async (e) => {
138
144
  try {
139
145
  let n = (await j().mutate({
140
- mutation: l,
146
+ mutation: u,
141
147
  variables: { input: e }
142
148
  })).data?.deliverNotification;
143
149
  return n ? (t("delivery.completed", {
@@ -154,7 +160,7 @@ function T(a) {
154
160
  };
155
161
  } catch (e) {
156
162
  let t = e instanceof Error ? e.message : "Failed to deliver notification";
157
- return w(e, "Failed to deliver notification"), {
163
+ return T(e, "Failed to deliver notification"), {
158
164
  success: !1,
159
165
  error: t
160
166
  };
@@ -162,94 +168,94 @@ function T(a) {
162
168
  }, [j])
163
169
  };
164
170
  }
165
- function E(r) {
166
- let { authToken: i, apiGatewayUrl: o, organizationId: s } = e(), [d, T] = C(null), [E, D] = C(!0), [O, k] = C(null), A = x(() => n(o, i, s), [
167
- o,
171
+ function D(n) {
172
+ let { authToken: i, apiGatewayUrl: a, organizationId: s } = e(), [c, f] = w(null), [E, D] = w(!0), [O, k] = w(null), A = S(() => r(a, i, s), [
173
+ a,
168
174
  i,
169
175
  s
170
- ]), j = x(async () => {
171
- if (!r) {
172
- T(null), D(!1);
176
+ ]), j = S(async () => {
177
+ if (!n) {
178
+ f(null), D(!1);
173
179
  return;
174
180
  }
175
181
  D(!0), k(null);
176
182
  try {
177
- T((await A().query({
178
- query: u,
179
- variables: { id: r },
183
+ f((await A().query({
184
+ query: d,
185
+ variables: { id: n },
180
186
  fetchPolicy: "network-only"
181
187
  })).data?.getChannel ?? null);
182
188
  } catch (e) {
183
189
  let t = e instanceof Error ? e.message : "Failed to fetch channel";
184
- w(e, "Failed to fetch channel"), k(t);
190
+ T(e, "Failed to fetch channel"), k(t);
185
191
  } finally {
186
192
  D(!1);
187
193
  }
188
- }, [r, A]);
189
- S(() => {
194
+ }, [n, A]);
195
+ C(() => {
190
196
  Promise.resolve().then(() => j());
191
197
  }, [j]);
192
- let M = x(async (e) => {
193
- if (!r) return null;
198
+ let M = S(async (e) => {
199
+ if (!n) return null;
194
200
  try {
195
- let n = await A().mutate({
196
- mutation: y,
201
+ let r = await A().mutate({
202
+ mutation: b,
197
203
  variables: {
198
- id: r,
204
+ id: n,
199
205
  input: e
200
206
  }
201
207
  });
202
- return t("channel.updated", { id: r }), await j(), n.data?.updateChannel ?? null;
208
+ return t("channel.updated", { id: n }), await j(), r.data?.updateChannel ?? null;
203
209
  } catch (e) {
204
210
  let t = e instanceof Error ? e.message : "Failed to update channel";
205
- return w(e, "Failed to update channel"), k(t), null;
211
+ return T(e, "Failed to update channel"), k(t), null;
206
212
  }
207
213
  }, [
208
- r,
214
+ n,
209
215
  A,
210
216
  j
211
- ]), N = x(async () => {
212
- if (!r) return null;
217
+ ]), N = S(async () => {
218
+ if (!n) return null;
213
219
  try {
214
220
  let e = await A().mutate({
215
- mutation: _,
216
- variables: { id: r }
221
+ mutation: v,
222
+ variables: { id: n }
217
223
  });
218
224
  return await j(), e.data?.runChannelHealthCheck ?? null;
219
225
  } catch (e) {
220
226
  let t = e instanceof Error ? e.message : "Failed to run health check";
221
- return w(e, "Failed to run health check"), k(t), null;
227
+ return T(e, "Failed to run health check"), k(t), null;
222
228
  }
223
229
  }, [
224
- r,
230
+ n,
225
231
  A,
226
232
  j
227
- ]), P = x(async (e) => {
228
- if (!r) return null;
233
+ ]), P = S(async (e) => {
234
+ if (!n) return null;
229
235
  try {
230
- let n = (await A().mutate({
231
- mutation: a,
236
+ let r = (await A().mutate({
237
+ mutation: o,
232
238
  variables: { input: {
233
239
  ...e,
234
- channelId: r
240
+ channelId: n
235
241
  } }
236
242
  })).data?.createConnection ?? null;
237
- return n && t("connection.created", {
238
- id: n.id,
239
- channelId: r
240
- }), await j(), n;
243
+ return r && t("connection.created", {
244
+ id: r.id,
245
+ channelId: n
246
+ }), await j(), r;
241
247
  } catch (e) {
242
248
  let t = e instanceof Error ? e.message : "Failed to create connection";
243
- return w(e, "Failed to create connection"), k(t), null;
249
+ return T(e, "Failed to create connection"), k(t), null;
244
250
  }
245
251
  }, [
246
- r,
252
+ n,
247
253
  A,
248
254
  j
249
- ]), F = x(async (e, n) => {
255
+ ]), F = S(async (e, n) => {
250
256
  try {
251
257
  let r = await A().mutate({
252
- mutation: b,
258
+ mutation: x,
253
259
  variables: {
254
260
  id: e,
255
261
  input: n
@@ -258,43 +264,43 @@ function E(r) {
258
264
  return t("connection.updated", { id: e }), await j(), r.data?.updateConnection ?? null;
259
265
  } catch (e) {
260
266
  let t = e instanceof Error ? e.message : "Failed to update connection";
261
- return w(e, "Failed to update connection"), k(t), null;
267
+ return T(e, "Failed to update connection"), k(t), null;
262
268
  }
263
- }, [A, j]), I = x(async (e) => {
269
+ }, [A, j]), I = S(async (e) => {
264
270
  try {
265
271
  await A().mutate({
266
- mutation: c,
272
+ mutation: l,
267
273
  variables: { id: e },
268
274
  update(t) {
269
275
  t.evict({ id: `ChannelConnection:${e}` }), t.gc();
270
276
  }
271
277
  }), t("connection.deleted", { id: e }), await j();
272
278
  } catch (e) {
273
- throw w(e, "Failed to delete connection"), e;
279
+ throw T(e, "Failed to delete connection"), e;
274
280
  }
275
- }, [A, j]), L = x(async (e) => {
281
+ }, [A, j]), L = S(async (e) => {
276
282
  try {
277
283
  let t = await A().mutate({
278
- mutation: v,
284
+ mutation: y,
279
285
  variables: { id: e }
280
286
  });
281
287
  return await j(), t.data?.testConnectionHealth ?? null;
282
288
  } catch (e) {
283
- throw w(e, "Failed to test connection"), e;
289
+ throw T(e, "Failed to test connection"), e;
284
290
  }
285
- }, [A, j]), R = x(async (e, n, r) => {
286
- if (!d) return null;
291
+ }, [A, j]), R = S(async (e, n, r) => {
292
+ if (!c) return null;
287
293
  try {
288
294
  let i = A(), a = { text: n };
289
- d.platform === "EMAIL" ? (a.subject = r?.subject ?? "Test Notification", r?.html && (a.html = r.html)) : d.platform === "PUSH" && (a.title = r?.subject ?? "Test Notification");
295
+ c.platform === "EMAIL" ? (a.subject = r?.subject ?? "Test Notification", r?.html && (a.html = r.html)) : c.platform === "PUSH" && (a.title = r?.subject ?? "Test Notification");
290
296
  let o = {
291
- platform: d.platform,
292
- organizationId: d.organizationId,
297
+ platform: c.platform,
298
+ organizationId: c.organizationId,
293
299
  recipient: e,
294
300
  content: a,
295
- connectionId: d.connection?.id
301
+ connectionId: c.connection?.id
296
302
  }, s = (await i.mutate({
297
- mutation: l,
303
+ mutation: u,
298
304
  variables: { input: o }
299
305
  })).data?.deliverNotification ?? null;
300
306
  return s && t("delivery.completed", {
@@ -305,26 +311,26 @@ function E(r) {
305
311
  test: !0
306
312
  }), s;
307
313
  } catch (e) {
308
- throw w(e, "Failed to send test message"), e;
314
+ throw T(e, "Failed to send test message"), e;
309
315
  }
310
- }, [d, A]), z = x(async (e = 50) => {
311
- if (!r) return [];
316
+ }, [c, A]), z = S(async (e = 50) => {
317
+ if (!n) return [];
312
318
  try {
313
319
  return (await A().query({
314
- query: f,
320
+ query: p,
315
321
  variables: {
316
- channelId: r,
322
+ channelId: n,
317
323
  limit: e
318
324
  },
319
325
  fetchPolicy: "network-only"
320
326
  })).data?.getChannelDeliveryAttempts?.items ?? [];
321
327
  } catch (e) {
322
328
  let t = e instanceof Error ? e.message : "Failed to fetch delivery attempts";
323
- return w(e, "Failed to fetch delivery attempts"), k(t), [];
329
+ return T(e, "Failed to fetch delivery attempts"), k(t), [];
324
330
  }
325
- }, [r, A]);
331
+ }, [n, A]);
326
332
  return {
327
- channel: d,
333
+ channel: c,
328
334
  isLoading: E,
329
335
  error: O,
330
336
  refetch: j,
@@ -336,42 +342,42 @@ function E(r) {
336
342
  testConnection: L,
337
343
  sendTestNotification: R,
338
344
  fetchDeliveryAttempts: z,
339
- fetchWebhookEvents: x(async (e = 50) => {
340
- if (!r) return [];
345
+ fetchWebhookEvents: S(async (e = 50) => {
346
+ if (!n) return [];
341
347
  try {
342
348
  return (await A().query({
343
- query: h,
349
+ query: g,
344
350
  variables: {
345
- channelId: r,
351
+ channelId: n,
346
352
  limit: e
347
353
  },
348
354
  fetchPolicy: "network-only"
349
355
  })).data?.getChannelWebhookEvents?.items ?? [];
350
356
  } catch (e) {
351
357
  let t = e instanceof Error ? e.message : "Failed to fetch webhook events";
352
- return w(e, "Failed to fetch webhook events"), k(t), [];
358
+ return T(e, "Failed to fetch webhook events"), k(t), [];
353
359
  }
354
- }, [r, A]),
355
- fetchUserPlatformConnections: x(async (e = 50) => {
356
- if (!r) return [];
360
+ }, [n, A]),
361
+ fetchUserPlatformConnections: S(async (e = 50) => {
362
+ if (!n) return [];
357
363
  try {
358
364
  return (await A().query({
359
- query: m,
365
+ query: h,
360
366
  variables: {
361
- channelId: r,
367
+ channelId: n,
362
368
  pagination: { limit: e }
363
369
  },
364
370
  fetchPolicy: "network-only"
365
371
  })).data?.listUserPlatformConnectionsByChannel?.items ?? [];
366
372
  } catch (e) {
367
373
  let t = e instanceof Error ? e.message : "Failed to fetch user platform connections";
368
- return w(e, "Failed to fetch user platform connections"), k(t), [];
374
+ return T(e, "Failed to fetch user platform connections"), k(t), [];
369
375
  }
370
- }, [r, A]),
371
- retryDelivery: x(async (e) => {
376
+ }, [n, A]),
377
+ retryDelivery: S(async (e) => {
372
378
  try {
373
379
  let n = (await A().mutate({
374
- mutation: g,
380
+ mutation: _,
375
381
  variables: { attemptId: e }
376
382
  })).data?.retryDelivery;
377
383
  return n?.success ? (t("delivery.completed", {
@@ -385,19 +391,19 @@ function E(r) {
385
391
  };
386
392
  } catch (e) {
387
393
  let t = e instanceof Error ? e.message : "Failed to retry delivery";
388
- return w(e, "Failed to retry delivery"), {
394
+ return T(e, "Failed to retry delivery"), {
389
395
  success: !1,
390
396
  error: t
391
397
  };
392
398
  }
393
399
  }, [A, z]),
394
- fetchDeliveryStats: x(async (e, t) => {
395
- if (!r) return null;
400
+ fetchDeliveryStats: S(async (e, t) => {
401
+ if (!n) return null;
396
402
  try {
397
403
  return (await A().query({
398
- query: p,
404
+ query: m,
399
405
  variables: {
400
- channelId: r,
406
+ channelId: n,
401
407
  startDate: e,
402
408
  endDate: t
403
409
  },
@@ -405,12 +411,12 @@ function E(r) {
405
411
  })).data?.getDeliveryStats ?? null;
406
412
  } catch (e) {
407
413
  let t = e instanceof Error ? e.message : "Failed to fetch delivery stats";
408
- return w(e, "Failed to fetch delivery stats"), k(t), null;
414
+ return T(e, "Failed to fetch delivery stats"), k(t), null;
409
415
  }
410
- }, [r, A])
416
+ }, [n, A])
411
417
  };
412
418
  }
413
419
  //#endregion
414
- export { E as useChannel, T as useChannels };
420
+ export { D as useChannel, E as useChannels };
415
421
 
416
422
  //# sourceMappingURL=useChannels.js.map