@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.
- package/dist/channel/ChannelRoot.js +1 -1
- package/dist/channel/ChannelRoot.js.map +1 -1
- package/dist/channel/hooks/useChannelSubscription.d.ts +4 -4
- package/dist/channel/hooks/useChannelSubscription.d.ts.map +1 -1
- package/dist/channel/hooks/useChannelSubscription.js +2 -2
- package/dist/channel/hooks/useChannelSubscription.js.map +1 -1
- package/dist/channel/hooks/useChannels.d.ts.map +1 -1
- package/dist/channel/hooks/useChannels.js +130 -124
- package/dist/channel/hooks/useChannels.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js +5 -5
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js +25 -7
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +7 -7
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionsListPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js +137 -133
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js +162 -158
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.js +5 -5
- package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.js +2 -2
- package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
- package/dist/channel/modules/channels/pages/WebhookEventsPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js +11 -3
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
- package/dist/translations/en.d.ts +260 -0
- package/dist/translations/en.d.ts.map +1 -0
- 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
|
|
4
|
-
import { ActivateChannelDocument as
|
|
5
|
-
import { useCallback as
|
|
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
|
|
8
|
-
|
|
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
|
|
11
|
-
let { authToken:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]), M =
|
|
16
|
-
g(!0),
|
|
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:
|
|
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
|
-
|
|
38
|
+
T(e, "Failed to fetch channels"), y(t);
|
|
33
39
|
} finally {
|
|
34
40
|
g(!1);
|
|
35
41
|
}
|
|
36
42
|
}, [j, k]);
|
|
37
|
-
return
|
|
43
|
+
return C(() => {
|
|
38
44
|
Promise.resolve().then(() => M());
|
|
39
45
|
}, [M]), {
|
|
40
46
|
channels: p,
|
|
41
47
|
isLoading: h,
|
|
42
|
-
error:
|
|
43
|
-
hasMore:
|
|
48
|
+
error: _,
|
|
49
|
+
hasMore: x,
|
|
44
50
|
total: D,
|
|
45
51
|
filter: k,
|
|
46
52
|
refetch: M,
|
|
47
|
-
createChannel:
|
|
53
|
+
createChannel: S(async (e) => {
|
|
48
54
|
try {
|
|
49
55
|
let n = (await j().mutate({
|
|
50
|
-
mutation:
|
|
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
|
|
65
|
+
return T(e, "Failed to create channel"), y(t), null;
|
|
60
66
|
}
|
|
61
67
|
}, [j, M]),
|
|
62
|
-
updateChannel:
|
|
68
|
+
updateChannel: S(async (e, n) => {
|
|
63
69
|
try {
|
|
64
70
|
let r = await j().mutate({
|
|
65
|
-
mutation:
|
|
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
|
|
80
|
+
return T(e, "Failed to update channel"), y(t), null;
|
|
75
81
|
}
|
|
76
82
|
}, [j, M]),
|
|
77
|
-
deleteChannel:
|
|
83
|
+
deleteChannel: S(async (e) => {
|
|
78
84
|
try {
|
|
79
85
|
return await j().mutate({
|
|
80
|
-
mutation:
|
|
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
|
|
91
|
+
return T(e, "Failed to delete channel"), y(t), !1;
|
|
86
92
|
}
|
|
87
93
|
}, [j, M]),
|
|
88
|
-
activateChannel:
|
|
94
|
+
activateChannel: S(async (e) => {
|
|
89
95
|
try {
|
|
90
96
|
return await j().mutate({
|
|
91
|
-
mutation:
|
|
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
|
|
105
|
+
return T(e, "Failed to activate channel"), y(t), !1;
|
|
100
106
|
}
|
|
101
107
|
}, [j, M]),
|
|
102
|
-
deactivateChannel:
|
|
108
|
+
deactivateChannel: S(async (e) => {
|
|
103
109
|
try {
|
|
104
110
|
return await j().mutate({
|
|
105
|
-
mutation:
|
|
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
|
|
119
|
+
return T(e, "Failed to deactivate channel"), y(t), !1;
|
|
114
120
|
}
|
|
115
121
|
}, [j, M]),
|
|
116
|
-
runHealthCheck:
|
|
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
|
|
131
|
+
return T(e, "Failed to run health check"), y(t), null;
|
|
126
132
|
}
|
|
127
133
|
}, [j, M]),
|
|
128
|
-
updateFilter:
|
|
134
|
+
updateFilter: S((e) => {
|
|
129
135
|
A((t) => ({
|
|
130
136
|
...t,
|
|
131
137
|
...e
|
|
132
138
|
}));
|
|
133
139
|
}, []),
|
|
134
|
-
resetFilter:
|
|
140
|
+
resetFilter: S(() => {
|
|
135
141
|
A({});
|
|
136
142
|
}, []),
|
|
137
|
-
deliverNotification:
|
|
143
|
+
deliverNotification: S(async (e) => {
|
|
138
144
|
try {
|
|
139
145
|
let n = (await j().mutate({
|
|
140
|
-
mutation:
|
|
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
|
|
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
|
|
166
|
-
let { authToken: i, apiGatewayUrl:
|
|
167
|
-
|
|
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 =
|
|
171
|
-
if (!
|
|
172
|
-
|
|
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
|
-
|
|
178
|
-
query:
|
|
179
|
-
variables: { id:
|
|
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
|
-
|
|
190
|
+
T(e, "Failed to fetch channel"), k(t);
|
|
185
191
|
} finally {
|
|
186
192
|
D(!1);
|
|
187
193
|
}
|
|
188
|
-
}, [
|
|
189
|
-
|
|
194
|
+
}, [n, A]);
|
|
195
|
+
C(() => {
|
|
190
196
|
Promise.resolve().then(() => j());
|
|
191
197
|
}, [j]);
|
|
192
|
-
let M =
|
|
193
|
-
if (!
|
|
198
|
+
let M = S(async (e) => {
|
|
199
|
+
if (!n) return null;
|
|
194
200
|
try {
|
|
195
|
-
let
|
|
196
|
-
mutation:
|
|
201
|
+
let r = await A().mutate({
|
|
202
|
+
mutation: b,
|
|
197
203
|
variables: {
|
|
198
|
-
id:
|
|
204
|
+
id: n,
|
|
199
205
|
input: e
|
|
200
206
|
}
|
|
201
207
|
});
|
|
202
|
-
return t("channel.updated", { id:
|
|
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
|
|
211
|
+
return T(e, "Failed to update channel"), k(t), null;
|
|
206
212
|
}
|
|
207
213
|
}, [
|
|
208
|
-
|
|
214
|
+
n,
|
|
209
215
|
A,
|
|
210
216
|
j
|
|
211
|
-
]), N =
|
|
212
|
-
if (!
|
|
217
|
+
]), N = S(async () => {
|
|
218
|
+
if (!n) return null;
|
|
213
219
|
try {
|
|
214
220
|
let e = await A().mutate({
|
|
215
|
-
mutation:
|
|
216
|
-
variables: { id:
|
|
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
|
|
227
|
+
return T(e, "Failed to run health check"), k(t), null;
|
|
222
228
|
}
|
|
223
229
|
}, [
|
|
224
|
-
|
|
230
|
+
n,
|
|
225
231
|
A,
|
|
226
232
|
j
|
|
227
|
-
]), P =
|
|
228
|
-
if (!
|
|
233
|
+
]), P = S(async (e) => {
|
|
234
|
+
if (!n) return null;
|
|
229
235
|
try {
|
|
230
|
-
let
|
|
231
|
-
mutation:
|
|
236
|
+
let r = (await A().mutate({
|
|
237
|
+
mutation: o,
|
|
232
238
|
variables: { input: {
|
|
233
239
|
...e,
|
|
234
|
-
channelId:
|
|
240
|
+
channelId: n
|
|
235
241
|
} }
|
|
236
242
|
})).data?.createConnection ?? null;
|
|
237
|
-
return
|
|
238
|
-
id:
|
|
239
|
-
channelId:
|
|
240
|
-
}), await j(),
|
|
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
|
|
249
|
+
return T(e, "Failed to create connection"), k(t), null;
|
|
244
250
|
}
|
|
245
251
|
}, [
|
|
246
|
-
|
|
252
|
+
n,
|
|
247
253
|
A,
|
|
248
254
|
j
|
|
249
|
-
]), F =
|
|
255
|
+
]), F = S(async (e, n) => {
|
|
250
256
|
try {
|
|
251
257
|
let r = await A().mutate({
|
|
252
|
-
mutation:
|
|
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
|
|
267
|
+
return T(e, "Failed to update connection"), k(t), null;
|
|
262
268
|
}
|
|
263
|
-
}, [A, j]), I =
|
|
269
|
+
}, [A, j]), I = S(async (e) => {
|
|
264
270
|
try {
|
|
265
271
|
await A().mutate({
|
|
266
|
-
mutation:
|
|
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
|
|
279
|
+
throw T(e, "Failed to delete connection"), e;
|
|
274
280
|
}
|
|
275
|
-
}, [A, j]), L =
|
|
281
|
+
}, [A, j]), L = S(async (e) => {
|
|
276
282
|
try {
|
|
277
283
|
let t = await A().mutate({
|
|
278
|
-
mutation:
|
|
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
|
|
289
|
+
throw T(e, "Failed to test connection"), e;
|
|
284
290
|
}
|
|
285
|
-
}, [A, j]), R =
|
|
286
|
-
if (!
|
|
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
|
-
|
|
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:
|
|
292
|
-
organizationId:
|
|
297
|
+
platform: c.platform,
|
|
298
|
+
organizationId: c.organizationId,
|
|
293
299
|
recipient: e,
|
|
294
300
|
content: a,
|
|
295
|
-
connectionId:
|
|
301
|
+
connectionId: c.connection?.id
|
|
296
302
|
}, s = (await i.mutate({
|
|
297
|
-
mutation:
|
|
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
|
|
314
|
+
throw T(e, "Failed to send test message"), e;
|
|
309
315
|
}
|
|
310
|
-
}, [
|
|
311
|
-
if (!
|
|
316
|
+
}, [c, A]), z = S(async (e = 50) => {
|
|
317
|
+
if (!n) return [];
|
|
312
318
|
try {
|
|
313
319
|
return (await A().query({
|
|
314
|
-
query:
|
|
320
|
+
query: p,
|
|
315
321
|
variables: {
|
|
316
|
-
channelId:
|
|
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
|
|
329
|
+
return T(e, "Failed to fetch delivery attempts"), k(t), [];
|
|
324
330
|
}
|
|
325
|
-
}, [
|
|
331
|
+
}, [n, A]);
|
|
326
332
|
return {
|
|
327
|
-
channel:
|
|
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:
|
|
340
|
-
if (!
|
|
345
|
+
fetchWebhookEvents: S(async (e = 50) => {
|
|
346
|
+
if (!n) return [];
|
|
341
347
|
try {
|
|
342
348
|
return (await A().query({
|
|
343
|
-
query:
|
|
349
|
+
query: g,
|
|
344
350
|
variables: {
|
|
345
|
-
channelId:
|
|
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
|
|
358
|
+
return T(e, "Failed to fetch webhook events"), k(t), [];
|
|
353
359
|
}
|
|
354
|
-
}, [
|
|
355
|
-
fetchUserPlatformConnections:
|
|
356
|
-
if (!
|
|
360
|
+
}, [n, A]),
|
|
361
|
+
fetchUserPlatformConnections: S(async (e = 50) => {
|
|
362
|
+
if (!n) return [];
|
|
357
363
|
try {
|
|
358
364
|
return (await A().query({
|
|
359
|
-
query:
|
|
365
|
+
query: h,
|
|
360
366
|
variables: {
|
|
361
|
-
channelId:
|
|
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
|
|
374
|
+
return T(e, "Failed to fetch user platform connections"), k(t), [];
|
|
369
375
|
}
|
|
370
|
-
}, [
|
|
371
|
-
retryDelivery:
|
|
376
|
+
}, [n, A]),
|
|
377
|
+
retryDelivery: S(async (e) => {
|
|
372
378
|
try {
|
|
373
379
|
let n = (await A().mutate({
|
|
374
|
-
mutation:
|
|
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
|
|
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:
|
|
395
|
-
if (!
|
|
400
|
+
fetchDeliveryStats: S(async (e, t) => {
|
|
401
|
+
if (!n) return null;
|
|
396
402
|
try {
|
|
397
403
|
return (await A().query({
|
|
398
|
-
query:
|
|
404
|
+
query: m,
|
|
399
405
|
variables: {
|
|
400
|
-
channelId:
|
|
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
|
|
414
|
+
return T(e, "Failed to fetch delivery stats"), k(t), null;
|
|
409
415
|
}
|
|
410
|
-
}, [
|
|
416
|
+
}, [n, A])
|
|
411
417
|
};
|
|
412
418
|
}
|
|
413
419
|
//#endregion
|
|
414
|
-
export {
|
|
420
|
+
export { D as useChannel, E as useChannels };
|
|
415
421
|
|
|
416
422
|
//# sourceMappingURL=useChannels.js.map
|