@burdenoff/microfe-timecampus 2026.1031.5 → 2026.1031.6
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/generated/global-types.d.ts +128 -7
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +138 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +1161 -1098
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +161 -2
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +11 -9
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/channels/ChannelsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/channels/ChannelsPage.js +394 -210
- package/dist/timecampus/pages/channels/ChannelsPage.js.map +1 -1
- package/dist/timecampus/pages/channels/channelCatalog.d.ts +18 -1
- package/dist/timecampus/pages/channels/channelCatalog.d.ts.map +1 -1
- package/dist/timecampus/pages/channels/channelCatalog.js +38 -27
- package/dist/timecampus/pages/channels/channelCatalog.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,44 +2,48 @@ import { useTimeCampus as e } from "../../providers/TimeCampusProvider.js";
|
|
|
2
2
|
import { cn as t, formatRelativeTime as n } from "../../utils/helpers.js";
|
|
3
3
|
import { StatCard as r } from "../../components/StatCard.js";
|
|
4
4
|
import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
|
|
5
|
-
import { EmptyState as
|
|
6
|
-
import { useConnectTimeCampusCaptureChannelMutation as
|
|
7
|
-
import { PageLayout as
|
|
5
|
+
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
6
|
+
import { useConnectTimeCampusCaptureChannelMutation as ee, useDeleteTimeCampusCaptureChannelMutation as te, useDisconnectTimeCampusCaptureChannelMutation as ne, useMyTimeCampusCaptureChannelsQuery as re, usePurgeTimeCampusCaptureChannelEventsMutation as ie, useSyncTimeCampusCaptureChannelMutation as o, useTimeCampusCapturePullProvidersQuery as ae, useUpdateTimeCampusCaptureChannelMutation as s } from "../../../generated/wspace-operations.js";
|
|
7
|
+
import { PageLayout as c } from "../../components/PageLayout.js";
|
|
8
8
|
import { StatusBadge as l } from "../../components/StatusBadge.js";
|
|
9
9
|
import { Modal as u } from "../../components/Modal.js";
|
|
10
|
-
import { ToastContainer as
|
|
10
|
+
import { ToastContainer as oe, useToast as se } from "../../components/Toast.js";
|
|
11
11
|
import "../../components/index.js";
|
|
12
|
-
import { TimeCampusCaptureChannelPrivacyMode as d, TimeCampusCaptureChannelStatus as f,
|
|
13
|
-
import { CHANNEL_CATALOG as
|
|
14
|
-
import { useMemo as
|
|
15
|
-
import { AppWindow as
|
|
12
|
+
import { TimeCampusCaptureChannelPrivacyMode as d, TimeCampusCaptureChannelStatus as f, TimeCampusCaptureChannelSyncStatus as p, TimeCampusCaptureChannelType as m } from "../../../generated/wspace-types.js";
|
|
13
|
+
import { CHANNEL_CATALOG as ce, PRIVACY_OPTIONS as h, catalogEntry as g, channelSetupHint as le, formatRetention as _, formatSyncInterval as ue, isOverdue as v, matchesChannelSearch as de, oauthCallbackUrl as fe, parseOptionalPositiveInt as y, privacyLabel as pe, pullHealth as b, statusDisplay as x } from "./channelCatalog.js";
|
|
14
|
+
import { useMemo as me, useState as S } from "react";
|
|
15
|
+
import { AlertTriangle as C, AppWindow as w, Calendar as T, Check as he, Code2 as ge, Copy as _e, Globe as ve, Link2 as ye, Pause as E, Play as be, Plug as xe, PlugZap as D, Plus as Se, RefreshCw as O, Search as Ce, Settings2 as we, Smartphone as k, Terminal as A, Trash2 as Te, Unplug as Ee, Webhook as j, Workflow as De } from "lucide-react";
|
|
16
|
+
import { useApolloClient as Oe } from "@apollo/client/react";
|
|
16
17
|
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
17
|
-
import { GlassCard as
|
|
18
|
+
import { GlassCard as ke } from "@burdenoff/fe-libs/ui";
|
|
19
|
+
import { ConnectionDialog as Ae } from "@burdenoff/fe-libs/connections";
|
|
18
20
|
//#region src/timecampus/pages/channels/ChannelsPage.tsx
|
|
19
|
-
var
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
21
|
+
var F = 3650, I = 10080, L = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg/50", R = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50", z = "inline-flex items-center justify-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", je = "inline-flex items-center justify-center gap-1.5 rounded-md bg-status-error-bg px-3 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/80 disabled:opacity-50", B = {
|
|
22
|
+
[m.Browser]: /* @__PURE__ */ N(ve, { className: "h-5 w-5" }),
|
|
23
|
+
[m.Desktop]: /* @__PURE__ */ N(w, { className: "h-5 w-5" }),
|
|
24
|
+
[m.Mobile]: /* @__PURE__ */ N(k, { className: "h-5 w-5" }),
|
|
25
|
+
[m.Ide]: /* @__PURE__ */ N(ge, { className: "h-5 w-5" }),
|
|
26
|
+
[m.Cli]: /* @__PURE__ */ N(A, { className: "h-5 w-5" }),
|
|
27
|
+
[m.Calendar]: /* @__PURE__ */ N(T, { className: "h-5 w-5" }),
|
|
28
|
+
[m.Api]: /* @__PURE__ */ N(j, { className: "h-5 w-5" }),
|
|
29
|
+
[m.Integration]: /* @__PURE__ */ N(ye, { className: "h-5 w-5" }),
|
|
30
|
+
[m.Custom]: /* @__PURE__ */ N(De, { className: "h-5 w-5" })
|
|
28
31
|
};
|
|
29
|
-
function
|
|
30
|
-
let
|
|
31
|
-
if (!
|
|
32
|
-
let
|
|
33
|
-
if (!
|
|
34
|
-
let
|
|
35
|
-
return
|
|
36
|
-
name:
|
|
32
|
+
function Me(e, t = 1) {
|
|
33
|
+
let n = e.name.trim();
|
|
34
|
+
if (!n || n.length > 120) return { error: "Give the channel a name of up to 120 characters." };
|
|
35
|
+
let r = y(e.retentionDays, F);
|
|
36
|
+
if (!r.ok) return { error: `Retention must be a whole number of days between 1 and ${F}, or empty to keep data.` };
|
|
37
|
+
let i = y(e.syncIntervalMinutes, I);
|
|
38
|
+
return !i.ok || i.value != null && i.value < t ? { error: `Sync interval must be a whole number of minutes between ${t} and ${I}, or empty.` } : {
|
|
39
|
+
name: n,
|
|
37
40
|
privacyMode: e.privacyMode,
|
|
38
|
-
retentionDays:
|
|
39
|
-
syncIntervalMinutes:
|
|
40
|
-
}
|
|
41
|
+
retentionDays: r.value,
|
|
42
|
+
syncIntervalMinutes: i.value
|
|
43
|
+
};
|
|
41
44
|
}
|
|
42
|
-
function
|
|
45
|
+
function Ne({ form: e, onChange: n, idPrefix: r, pullMinInterval: i }) {
|
|
46
|
+
let a = i != null;
|
|
43
47
|
return /* @__PURE__ */ P("div", {
|
|
44
48
|
className: "space-y-4",
|
|
45
49
|
children: [
|
|
@@ -56,14 +60,14 @@ function Se({ form: e, onChange: n, idPrefix: r }) {
|
|
|
56
60
|
...e,
|
|
57
61
|
name: t.target.value
|
|
58
62
|
}),
|
|
59
|
-
className:
|
|
63
|
+
className: L
|
|
60
64
|
})] }),
|
|
61
65
|
/* @__PURE__ */ P("fieldset", { children: [/* @__PURE__ */ N("legend", {
|
|
62
66
|
className: "block text-sm font-medium text-text-primary",
|
|
63
67
|
children: "Privacy"
|
|
64
68
|
}), /* @__PURE__ */ N("div", {
|
|
65
69
|
className: "mt-2 space-y-2",
|
|
66
|
-
children:
|
|
70
|
+
children: h.map((i) => /* @__PURE__ */ P("label", {
|
|
67
71
|
className: t("flex cursor-pointer items-start gap-3 rounded-lg border p-3", e.privacyMode === i.value ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle"),
|
|
68
72
|
children: [/* @__PURE__ */ N("input", {
|
|
69
73
|
type: "radio",
|
|
@@ -102,7 +106,7 @@ function Se({ form: e, onChange: n, idPrefix: r }) {
|
|
|
102
106
|
...e,
|
|
103
107
|
retentionDays: t.target.value
|
|
104
108
|
}),
|
|
105
|
-
className:
|
|
109
|
+
className: L
|
|
106
110
|
}),
|
|
107
111
|
/* @__PURE__ */ N("p", {
|
|
108
112
|
className: "mt-1 text-xs text-text-secondary",
|
|
@@ -112,30 +116,30 @@ function Se({ form: e, onChange: n, idPrefix: r }) {
|
|
|
112
116
|
/* @__PURE__ */ N("label", {
|
|
113
117
|
htmlFor: `${r}-interval`,
|
|
114
118
|
className: "block text-sm font-medium text-text-primary",
|
|
115
|
-
children: "Expected sync interval (minutes)"
|
|
119
|
+
children: a ? "Sync every (minutes)" : "Expected sync interval (minutes)"
|
|
116
120
|
}),
|
|
117
121
|
/* @__PURE__ */ N("input", {
|
|
118
122
|
id: `${r}-interval`,
|
|
119
123
|
type: "text",
|
|
120
124
|
inputMode: "numeric",
|
|
121
|
-
placeholder: "On demand",
|
|
125
|
+
placeholder: a ? "Provider default" : "On demand",
|
|
122
126
|
value: e.syncIntervalMinutes,
|
|
123
127
|
onChange: (t) => n({
|
|
124
128
|
...e,
|
|
125
129
|
syncIntervalMinutes: t.target.value
|
|
126
130
|
}),
|
|
127
|
-
className:
|
|
131
|
+
className: L
|
|
128
132
|
}),
|
|
129
133
|
/* @__PURE__ */ N("p", {
|
|
130
134
|
className: "mt-1 text-xs text-text-secondary",
|
|
131
|
-
children: "Used to flag a source that has gone quiet."
|
|
135
|
+
children: a ? `How often TimeCampus pulls new activity. At least ${i} minutes.` : "Used to flag a source that has gone quiet."
|
|
132
136
|
})
|
|
133
137
|
] })]
|
|
134
138
|
})
|
|
135
139
|
]
|
|
136
140
|
});
|
|
137
141
|
}
|
|
138
|
-
function
|
|
142
|
+
function Pe(e) {
|
|
139
143
|
return {
|
|
140
144
|
name: e.name,
|
|
141
145
|
privacyMode: e.privacyMode,
|
|
@@ -143,9 +147,9 @@ function Ce(e) {
|
|
|
143
147
|
syncIntervalMinutes: e.syncIntervalMinutes == null ? "" : String(e.syncIntervalMinutes)
|
|
144
148
|
};
|
|
145
149
|
}
|
|
146
|
-
function
|
|
147
|
-
let
|
|
148
|
-
return /* @__PURE__ */ P(
|
|
150
|
+
function Fe({ channel: e, busy: r, syncing: i, onManage: a, onTogglePause: ee, onResume: te, onSyncNow: ne, onReconnectAccount: re }) {
|
|
151
|
+
let ie = g(e.type), o = x(e.status), ae = v(e.status, e.lastSyncAt, e.syncIntervalMinutes), s = e.status === f.Disconnected, c = b(e), u = e.pullSync && (s || c === "reconnect");
|
|
152
|
+
return /* @__PURE__ */ P(ke, {
|
|
149
153
|
treatment: "glass",
|
|
150
154
|
className: "flex flex-col p-4 sm:p-5",
|
|
151
155
|
"data-testid": "channel-card",
|
|
@@ -153,8 +157,8 @@ function we({ channel: e, busy: r, onManage: i, onTogglePause: ee, onResume: a }
|
|
|
153
157
|
/* @__PURE__ */ P("div", {
|
|
154
158
|
className: "flex items-start gap-3",
|
|
155
159
|
children: [/* @__PURE__ */ N("div", {
|
|
156
|
-
className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",
|
|
157
|
-
children:
|
|
160
|
+
className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg", s ? "bg-bg-sunken text-text-secondary" : "bg-action-primary-bg/10 text-primary"),
|
|
161
|
+
children: B[e.type]
|
|
158
162
|
}), /* @__PURE__ */ P("div", {
|
|
159
163
|
className: "min-w-0 flex-1",
|
|
160
164
|
children: [/* @__PURE__ */ N("h3", {
|
|
@@ -162,7 +166,7 @@ function we({ channel: e, busy: r, onManage: i, onTogglePause: ee, onResume: a }
|
|
|
162
166
|
children: e.name
|
|
163
167
|
}), /* @__PURE__ */ P("p", {
|
|
164
168
|
className: "truncate text-xs text-text-secondary",
|
|
165
|
-
children: [
|
|
169
|
+
children: [ie.label, e.provider ? ` · ${e.provider}` : ""]
|
|
166
170
|
})]
|
|
167
171
|
})]
|
|
168
172
|
}),
|
|
@@ -170,16 +174,24 @@ function we({ channel: e, busy: r, onManage: i, onTogglePause: ee, onResume: a }
|
|
|
170
174
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
171
175
|
children: [
|
|
172
176
|
/* @__PURE__ */ N(l, {
|
|
173
|
-
label:
|
|
174
|
-
variant:
|
|
177
|
+
label: o.label,
|
|
178
|
+
variant: o.tone,
|
|
175
179
|
dot: !0
|
|
176
180
|
}),
|
|
177
|
-
|
|
181
|
+
ae && /* @__PURE__ */ N(l, {
|
|
178
182
|
label: "Sync overdue",
|
|
179
183
|
variant: "warning"
|
|
180
184
|
}),
|
|
185
|
+
e.pullSync && c === "reconnect" && /* @__PURE__ */ N(l, {
|
|
186
|
+
label: "Reconnect needed",
|
|
187
|
+
variant: "warning"
|
|
188
|
+
}),
|
|
189
|
+
e.pullSync && c === "error" && /* @__PURE__ */ N(l, {
|
|
190
|
+
label: "Last sync failed",
|
|
191
|
+
variant: "error"
|
|
192
|
+
}),
|
|
181
193
|
/* @__PURE__ */ N(l, {
|
|
182
|
-
label:
|
|
194
|
+
label: pe(e.privacyMode),
|
|
183
195
|
variant: "muted"
|
|
184
196
|
})
|
|
185
197
|
]
|
|
@@ -204,7 +216,7 @@ function we({ channel: e, busy: r, onManage: i, onTogglePause: ee, onResume: a }
|
|
|
204
216
|
children: "Interval"
|
|
205
217
|
}), /* @__PURE__ */ N("dd", {
|
|
206
218
|
className: "text-right text-text-primary",
|
|
207
|
-
children:
|
|
219
|
+
children: ue(e.syncIntervalMinutes)
|
|
208
220
|
})]
|
|
209
221
|
}),
|
|
210
222
|
/* @__PURE__ */ P("div", {
|
|
@@ -224,40 +236,66 @@ function we({ channel: e, busy: r, onManage: i, onTogglePause: ee, onResume: a }
|
|
|
224
236
|
children: "Retention"
|
|
225
237
|
}), /* @__PURE__ */ N("dd", {
|
|
226
238
|
className: "text-right text-text-primary",
|
|
227
|
-
children:
|
|
239
|
+
children: _(e.retentionDays)
|
|
228
240
|
})]
|
|
229
241
|
})
|
|
230
242
|
]
|
|
231
243
|
}),
|
|
244
|
+
e.pullSync && e.lastSyncError && c !== "ok" && /* @__PURE__ */ P("p", {
|
|
245
|
+
className: "mt-3 flex items-start gap-1.5 text-xs text-status-warning-text",
|
|
246
|
+
"data-testid": "channel-sync-error",
|
|
247
|
+
children: [/* @__PURE__ */ N(C, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ N("span", {
|
|
248
|
+
className: "line-clamp-3",
|
|
249
|
+
children: e.lastSyncError
|
|
250
|
+
})]
|
|
251
|
+
}),
|
|
232
252
|
/* @__PURE__ */ P("div", {
|
|
233
253
|
className: "mt-4 grid grid-cols-2 gap-2",
|
|
234
|
-
children: [
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
children: [
|
|
255
|
+
/* @__PURE__ */ P("button", {
|
|
256
|
+
type: "button",
|
|
257
|
+
className: R,
|
|
258
|
+
onClick: a,
|
|
259
|
+
"aria-label": `Manage ${e.name}`,
|
|
260
|
+
children: [/* @__PURE__ */ N(we, { className: "h-4 w-4" }), "Manage"]
|
|
261
|
+
}),
|
|
262
|
+
u ? /* @__PURE__ */ P("button", {
|
|
263
|
+
type: "button",
|
|
264
|
+
className: R,
|
|
265
|
+
onClick: re,
|
|
266
|
+
disabled: r,
|
|
267
|
+
"aria-label": `Connect ${e.name} again`,
|
|
268
|
+
children: [/* @__PURE__ */ N(D, { className: "h-4 w-4" }), "Reconnect"]
|
|
269
|
+
}) : s ? /* @__PURE__ */ P("button", {
|
|
270
|
+
type: "button",
|
|
271
|
+
className: R,
|
|
272
|
+
onClick: te,
|
|
273
|
+
disabled: r,
|
|
274
|
+
"aria-label": `Reconnect ${e.name}`,
|
|
275
|
+
children: [/* @__PURE__ */ N(D, { className: "h-4 w-4" }), "Reconnect"]
|
|
276
|
+
}) : /* @__PURE__ */ N("button", {
|
|
277
|
+
type: "button",
|
|
278
|
+
className: R,
|
|
279
|
+
onClick: ee,
|
|
280
|
+
disabled: r,
|
|
281
|
+
"aria-label": `${e.status === f.Paused ? "Resume" : "Pause"} ${e.name}`,
|
|
282
|
+
children: e.status === f.Paused ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(be, { className: "h-4 w-4" }), "Resume"] }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(E, { className: "h-4 w-4" }), "Pause"] })
|
|
283
|
+
}),
|
|
284
|
+
e.pullSync && e.status === f.Active && !u && /* @__PURE__ */ P("button", {
|
|
285
|
+
type: "button",
|
|
286
|
+
className: t(R, "col-span-2"),
|
|
287
|
+
onClick: ne,
|
|
288
|
+
disabled: i,
|
|
289
|
+
"aria-label": `Sync ${e.name} now`,
|
|
290
|
+
children: [/* @__PURE__ */ N(O, { className: t("h-4 w-4", i && "animate-spin") }), i ? "Syncing..." : "Sync now"]
|
|
291
|
+
})
|
|
292
|
+
]
|
|
255
293
|
})
|
|
256
294
|
]
|
|
257
295
|
});
|
|
258
296
|
}
|
|
259
|
-
function
|
|
260
|
-
let [n, r] =
|
|
297
|
+
function Ie({ channelId: e, type: t }) {
|
|
298
|
+
let [n, r] = S(!1);
|
|
261
299
|
return /* @__PURE__ */ P("div", { children: [
|
|
262
300
|
/* @__PURE__ */ N("p", {
|
|
263
301
|
className: "text-sm font-medium text-text-primary",
|
|
@@ -271,7 +309,7 @@ function Te({ channelId: e, type: t }) {
|
|
|
271
309
|
children: e
|
|
272
310
|
}), /* @__PURE__ */ P("button", {
|
|
273
311
|
type: "button",
|
|
274
|
-
className:
|
|
312
|
+
className: R,
|
|
275
313
|
onClick: async () => {
|
|
276
314
|
try {
|
|
277
315
|
await navigator.clipboard.writeText(e), r(!0), window.setTimeout(() => r(!1), 2e3);
|
|
@@ -280,170 +318,255 @@ function Te({ channelId: e, type: t }) {
|
|
|
280
318
|
}
|
|
281
319
|
},
|
|
282
320
|
"aria-label": "Copy channel ID",
|
|
283
|
-
children: [N(n ?
|
|
321
|
+
children: [N(n ? he : _e, { className: "h-4 w-4" }), n ? "Copied" : "Copy"]
|
|
284
322
|
})]
|
|
285
323
|
}),
|
|
286
324
|
/* @__PURE__ */ N("p", {
|
|
287
325
|
className: "mt-2 text-xs text-text-secondary",
|
|
288
326
|
"data-testid": "channel-setup-hint",
|
|
289
|
-
children:
|
|
327
|
+
children: le(t)
|
|
290
328
|
})
|
|
291
329
|
] });
|
|
292
330
|
}
|
|
293
|
-
function
|
|
294
|
-
|
|
331
|
+
function Le(e) {
|
|
332
|
+
return e.status === p.Synced ? {
|
|
333
|
+
title: e.ingested === 0 ? "Up to date: nothing new to capture" : `Captured ${e.ingested.toLocaleString()} new ${e.ingested === 1 ? "event" : "events"}`,
|
|
334
|
+
variant: "success"
|
|
335
|
+
} : {
|
|
336
|
+
title: e.status === p.ReconnectRequired ? "Connect the account again" : "Sync didn't finish",
|
|
337
|
+
description: e.error ?? void 0,
|
|
338
|
+
variant: "error"
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function V() {
|
|
342
|
+
let { workspaceId: n = "", apiGatewayUrl: l } = e(), p = Oe(), { toasts: m, addToast: h, dismissToast: le } = se(), [_, ue] = S(""), { data: v, loading: y, error: pe, refetch: b } = re({
|
|
295
343
|
variables: { includeDisconnected: !0 },
|
|
296
344
|
skip: !n,
|
|
297
345
|
fetchPolicy: "cache-and-network"
|
|
298
|
-
}), [
|
|
346
|
+
}), [x, { loading: C }] = ee(), [w, { loading: T }] = s(), [he] = ne(), [ge] = ie(), [_e] = te(), [ve] = o(), { data: ye } = ae({ skip: !n }), E = ye?.timeCampusCapturePullProviders ?? [], [be, O] = S(null), [we, k] = S(null), [A, j] = S(null), [ke, F] = S(!1), [I, V] = S(null), [Re, ze] = S({
|
|
299
347
|
name: "",
|
|
300
348
|
privacyMode: d.Full,
|
|
301
349
|
retentionDays: "",
|
|
302
350
|
syncIntervalMinutes: ""
|
|
303
|
-
}), [
|
|
351
|
+
}), [Be, H] = S(null), [U, W] = S(null), [G, Ve] = S(null), [K, q] = S(null), [He, J] = S(null), [Y, X] = S(null), [Ue, We] = S(!1), Z = me(() => v?.myTimeCampusCaptureChannels ?? [], [v]), Ge = me(() => Z.filter((e) => de(e, _)), [Z, _]), Ke = Z.filter((e) => e.status === f.Active).length, qe = Z.reduce((e, t) => e + t.totalEvents, 0), Je = {
|
|
304
352
|
title: "Channels",
|
|
305
353
|
description: "Manage and configure your connected capture sources",
|
|
306
354
|
purpose: "Channels are the sources that feed your automatic timeline: the browser extension, desktop and mobile apps, editors, the command line, calendars and your own API clients. Connect a source here, then decide how much detail it may store, how long its data is kept, and pause or disconnect it at any time. Your channels are private to you."
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
},
|
|
310
|
-
|
|
311
|
-
name:
|
|
355
|
+
}, Ye = () => {
|
|
356
|
+
V(null), W(null), H(null), F(!0);
|
|
357
|
+
}, Xe = (e) => {
|
|
358
|
+
V(e), ze({
|
|
359
|
+
name: g(e).defaultName,
|
|
312
360
|
privacyMode: d.Full,
|
|
313
361
|
retentionDays: "",
|
|
314
362
|
syncIntervalMinutes: ""
|
|
315
363
|
}), H(null);
|
|
316
364
|
}, Q = () => {
|
|
317
|
-
|
|
318
|
-
},
|
|
319
|
-
if (!
|
|
320
|
-
let e =
|
|
365
|
+
F(!1), V(null), W(null);
|
|
366
|
+
}, Ze = async () => {
|
|
367
|
+
if (!I) return;
|
|
368
|
+
let e = Me(Re);
|
|
321
369
|
if ("error" in e) {
|
|
322
370
|
H(e.error);
|
|
323
371
|
return;
|
|
324
372
|
}
|
|
325
373
|
H(null);
|
|
326
374
|
try {
|
|
327
|
-
let t = await
|
|
328
|
-
type:
|
|
375
|
+
let t = await x({ variables: { input: {
|
|
376
|
+
type: I,
|
|
329
377
|
...e
|
|
330
378
|
} } });
|
|
331
379
|
if (t.error) throw Error(t.error.message);
|
|
332
380
|
let n = t.data?.connectTimeCampusCaptureChannel;
|
|
333
381
|
if (!n) throw Error("No channel returned");
|
|
334
|
-
W(n), await
|
|
382
|
+
W(n), await b();
|
|
335
383
|
} catch (e) {
|
|
336
384
|
H(e instanceof Error && e.message ? e.message : "Couldn't connect this channel. Please try again.");
|
|
337
385
|
}
|
|
338
|
-
},
|
|
339
|
-
|
|
386
|
+
}, Qe = (e) => E.find((t) => t.key === e.provider), $e = (e) => {
|
|
387
|
+
Q(), j({
|
|
388
|
+
provider: e,
|
|
389
|
+
reconnect: null
|
|
390
|
+
});
|
|
391
|
+
}, et = (e) => {
|
|
392
|
+
let t = Qe(e);
|
|
393
|
+
if (!t) {
|
|
394
|
+
h({
|
|
395
|
+
title: "This account can't be connected from here",
|
|
396
|
+
variant: "error"
|
|
397
|
+
});
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
j({
|
|
401
|
+
provider: t,
|
|
402
|
+
reconnect: e
|
|
403
|
+
});
|
|
404
|
+
}, tt = async (e, t = !1) => {
|
|
405
|
+
k(e);
|
|
406
|
+
try {
|
|
407
|
+
let n = await ve({ variables: { id: e } });
|
|
408
|
+
if (n.error) throw Error(n.error.message);
|
|
409
|
+
let r = n.data?.syncTimeCampusCaptureChannel;
|
|
410
|
+
r && !t && h(Le(r));
|
|
411
|
+
} catch (e) {
|
|
412
|
+
t || h({
|
|
413
|
+
title: "Couldn't sync this channel",
|
|
414
|
+
description: e instanceof Error ? e.message : void 0,
|
|
415
|
+
variant: "error"
|
|
416
|
+
});
|
|
417
|
+
} finally {
|
|
418
|
+
k(null), await b();
|
|
419
|
+
}
|
|
420
|
+
}, nt = async (e) => {
|
|
421
|
+
let t = A;
|
|
422
|
+
if (!t) return;
|
|
423
|
+
let { provider: n, reconnect: r } = t;
|
|
424
|
+
try {
|
|
425
|
+
let t;
|
|
426
|
+
if (r) {
|
|
427
|
+
let n = await w({ variables: {
|
|
428
|
+
id: r.id,
|
|
429
|
+
input: {
|
|
430
|
+
integrationConnectionId: e.id,
|
|
431
|
+
status: f.Active
|
|
432
|
+
}
|
|
433
|
+
} });
|
|
434
|
+
if (n.error) throw Error(n.error.message);
|
|
435
|
+
t = r.id;
|
|
436
|
+
} else {
|
|
437
|
+
let r = await x({ variables: { input: {
|
|
438
|
+
name: n.label,
|
|
439
|
+
type: n.channelType,
|
|
440
|
+
provider: n.key,
|
|
441
|
+
integrationConnectionId: e.id,
|
|
442
|
+
privacyMode: d.Full
|
|
443
|
+
} } });
|
|
444
|
+
if (r.error) throw Error(r.error.message);
|
|
445
|
+
let i = r.data?.connectTimeCampusCaptureChannel;
|
|
446
|
+
if (!i) throw Error("No channel returned");
|
|
447
|
+
t = i.id;
|
|
448
|
+
}
|
|
449
|
+
j(null), h({
|
|
450
|
+
title: `${n.label} connected`,
|
|
451
|
+
description: "Pulling your recent activity now.",
|
|
452
|
+
variant: "success"
|
|
453
|
+
}), await tt(t);
|
|
454
|
+
} catch (e) {
|
|
455
|
+
h({
|
|
456
|
+
title: `Couldn't connect ${n.label}`,
|
|
457
|
+
description: e instanceof Error && e.message ? e.message : "Please try again.",
|
|
458
|
+
variant: "error"
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}, rt = (e) => {
|
|
462
|
+
Ve(e), q(Pe(e)), J(null);
|
|
340
463
|
}, $ = () => {
|
|
341
|
-
|
|
342
|
-
},
|
|
464
|
+
Ve(null), q(null);
|
|
465
|
+
}, it = async () => {
|
|
343
466
|
if (!G || !K) return;
|
|
344
|
-
let e =
|
|
467
|
+
let e = Me(K, G.pullSync ? Qe(G)?.minSyncIntervalMinutes ?? 1 : 1);
|
|
345
468
|
if ("error" in e) {
|
|
346
469
|
J(e.error);
|
|
347
470
|
return;
|
|
348
471
|
}
|
|
349
472
|
J(null);
|
|
350
473
|
try {
|
|
351
|
-
let t = await
|
|
474
|
+
let t = await w({ variables: {
|
|
352
475
|
id: G.id,
|
|
353
476
|
input: e
|
|
354
477
|
} });
|
|
355
478
|
if (t.error) throw Error(t.error.message);
|
|
356
|
-
await
|
|
479
|
+
await b(), h({
|
|
357
480
|
title: `${e.name} updated`,
|
|
358
481
|
variant: "success"
|
|
359
482
|
}), $();
|
|
360
483
|
} catch (e) {
|
|
361
484
|
J(e instanceof Error && e.message ? e.message : "Couldn't save these settings. Please try again.");
|
|
362
485
|
}
|
|
363
|
-
},
|
|
364
|
-
|
|
486
|
+
}, at = async (e, t) => {
|
|
487
|
+
O(e.id);
|
|
365
488
|
try {
|
|
366
|
-
let n = await
|
|
489
|
+
let n = await w({ variables: {
|
|
367
490
|
id: e.id,
|
|
368
491
|
input: { status: t }
|
|
369
492
|
} });
|
|
370
493
|
if (n.error) throw Error(n.error.message);
|
|
371
|
-
await
|
|
494
|
+
await b(), h({
|
|
372
495
|
title: t === f.Paused ? `${e.name} paused` : `${e.name} is capturing again`,
|
|
373
496
|
description: t === f.Paused ? "Events it sends while paused are refused and never stored." : void 0,
|
|
374
497
|
variant: "success"
|
|
375
498
|
});
|
|
376
499
|
} catch {
|
|
377
|
-
|
|
500
|
+
h({
|
|
378
501
|
title: "Couldn't change this channel",
|
|
379
502
|
description: "Nothing was changed. Please try again.",
|
|
380
503
|
variant: "error"
|
|
381
504
|
});
|
|
382
505
|
} finally {
|
|
383
|
-
|
|
506
|
+
O(null);
|
|
384
507
|
}
|
|
385
|
-
},
|
|
508
|
+
}, ot = async () => {
|
|
386
509
|
if (!Y) return;
|
|
387
510
|
let { channel: e } = Y;
|
|
388
|
-
|
|
511
|
+
We(!0);
|
|
389
512
|
try {
|
|
390
513
|
if (Y.kind === "disconnect") {
|
|
391
|
-
let t = await
|
|
514
|
+
let t = await he({ variables: { id: e.id } });
|
|
392
515
|
if (t.error) throw Error(t.error.message);
|
|
393
|
-
|
|
516
|
+
h({
|
|
394
517
|
title: `${e.name} disconnected`,
|
|
395
|
-
description: "Captured events are kept until you delete them.",
|
|
518
|
+
description: e.pullSync ? "TimeCampus no longer has access to the account. Captured events are kept until you delete them." : "Captured events are kept until you delete them.",
|
|
396
519
|
variant: "success"
|
|
397
520
|
});
|
|
398
521
|
} else if (Y.kind === "purge") {
|
|
399
|
-
let t = await
|
|
522
|
+
let t = await ge({ variables: {
|
|
400
523
|
id: e.id,
|
|
401
524
|
confirm: !0
|
|
402
525
|
} });
|
|
403
526
|
if (t.error) throw Error(t.error.message);
|
|
404
527
|
let n = t.data?.purgeTimeCampusCaptureChannelEvents.purgedEvents ?? 0;
|
|
405
|
-
|
|
528
|
+
h({
|
|
406
529
|
title: `Deleted ${n.toLocaleString()} captured ${n === 1 ? "event" : "events"}`,
|
|
407
530
|
variant: "success"
|
|
408
531
|
});
|
|
409
532
|
} else {
|
|
410
|
-
let t = await
|
|
533
|
+
let t = await _e({ variables: {
|
|
411
534
|
id: e.id,
|
|
412
535
|
confirm: !0
|
|
413
536
|
} });
|
|
414
537
|
if (t.error) throw Error(t.error.message);
|
|
415
|
-
|
|
538
|
+
h({
|
|
416
539
|
title: `${e.name} removed`,
|
|
417
540
|
variant: "success"
|
|
418
541
|
});
|
|
419
542
|
}
|
|
420
|
-
await
|
|
543
|
+
await b(), X(null), $();
|
|
421
544
|
} catch {
|
|
422
|
-
|
|
545
|
+
h({
|
|
423
546
|
title: "That didn't work",
|
|
424
547
|
description: "Nothing was changed. Please try again.",
|
|
425
548
|
variant: "error"
|
|
426
549
|
});
|
|
427
550
|
} finally {
|
|
428
|
-
|
|
551
|
+
We(!1);
|
|
429
552
|
}
|
|
430
|
-
},
|
|
553
|
+
}, st = /* @__PURE__ */ P("button", {
|
|
431
554
|
type: "button",
|
|
432
|
-
className:
|
|
433
|
-
onClick:
|
|
434
|
-
children: [/* @__PURE__ */ N(
|
|
435
|
-
}),
|
|
436
|
-
return /* @__PURE__ */ P(
|
|
437
|
-
...
|
|
438
|
-
actions:
|
|
555
|
+
className: z,
|
|
556
|
+
onClick: Ye,
|
|
557
|
+
children: [/* @__PURE__ */ N(Se, { className: "h-4 w-4" }), "Connect channel"]
|
|
558
|
+
}), ct = !n || y && !v;
|
|
559
|
+
return /* @__PURE__ */ P(c, {
|
|
560
|
+
...Je,
|
|
561
|
+
actions: st,
|
|
439
562
|
children: [
|
|
440
|
-
|
|
563
|
+
ct ? /* @__PURE__ */ N("div", {
|
|
441
564
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
442
565
|
children: /* @__PURE__ */ N(i, {
|
|
443
566
|
variant: "card",
|
|
444
567
|
count: 4
|
|
445
568
|
})
|
|
446
|
-
}) :
|
|
569
|
+
}) : pe && !v ? /* @__PURE__ */ N("div", {
|
|
447
570
|
className: "rounded-xl border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
|
|
448
571
|
children: "We couldn't load your channels right now. Please try again in a moment."
|
|
449
572
|
}) : /* @__PURE__ */ P("div", {
|
|
@@ -454,143 +577,204 @@ function H() {
|
|
|
454
577
|
/* @__PURE__ */ N(r, {
|
|
455
578
|
title: "Channels",
|
|
456
579
|
value: Z.length,
|
|
457
|
-
icon: /* @__PURE__ */ N(
|
|
580
|
+
icon: /* @__PURE__ */ N(xe, { className: "h-5 w-5" })
|
|
458
581
|
}),
|
|
459
582
|
/* @__PURE__ */ N(r, {
|
|
460
583
|
title: "Capturing now",
|
|
461
|
-
value:
|
|
462
|
-
icon: /* @__PURE__ */ N(
|
|
584
|
+
value: Ke,
|
|
585
|
+
icon: /* @__PURE__ */ N(D, { className: "h-5 w-5" })
|
|
463
586
|
}),
|
|
464
587
|
/* @__PURE__ */ N(r, {
|
|
465
588
|
title: "Events captured",
|
|
466
|
-
value:
|
|
467
|
-
icon: /* @__PURE__ */ N(
|
|
589
|
+
value: qe.toLocaleString(),
|
|
590
|
+
icon: /* @__PURE__ */ N(De, { className: "h-5 w-5" })
|
|
468
591
|
})
|
|
469
592
|
]
|
|
470
|
-
}), Z.length === 0 ? /* @__PURE__ */ N(
|
|
593
|
+
}), Z.length === 0 ? /* @__PURE__ */ N(a, {
|
|
471
594
|
illustration: "empty-data",
|
|
472
595
|
title: "No channels connected yet",
|
|
473
596
|
description: "Connect your first source — a browser, an editor, your calendar or an API client — and its activity will start assembling your timeline.",
|
|
474
|
-
action:
|
|
597
|
+
action: st
|
|
475
598
|
}) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P("div", {
|
|
476
599
|
className: "relative max-w-md",
|
|
477
|
-
children: [/* @__PURE__ */ N(
|
|
600
|
+
children: [/* @__PURE__ */ N(Ce, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ N("input", {
|
|
478
601
|
type: "search",
|
|
479
602
|
"aria-label": "Search channels",
|
|
480
603
|
placeholder: "Search channels...",
|
|
481
|
-
value:
|
|
482
|
-
onChange: (e) =>
|
|
483
|
-
className: t(
|
|
604
|
+
value: _,
|
|
605
|
+
onChange: (e) => ue(e.target.value),
|
|
606
|
+
className: t(L, "mt-0 pl-9")
|
|
484
607
|
})]
|
|
485
|
-
}),
|
|
608
|
+
}), Ge.length === 0 ? /* @__PURE__ */ P("p", {
|
|
486
609
|
className: "text-sm text-text-secondary",
|
|
487
610
|
children: [
|
|
488
611
|
"No channels match \"",
|
|
489
|
-
|
|
612
|
+
_,
|
|
490
613
|
"\"."
|
|
491
614
|
]
|
|
492
615
|
}) : /* @__PURE__ */ N("div", {
|
|
493
616
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
494
|
-
children:
|
|
617
|
+
children: Ge.map((e) => /* @__PURE__ */ N(Fe, {
|
|
495
618
|
channel: e,
|
|
496
|
-
busy:
|
|
497
|
-
onManage: () =>
|
|
498
|
-
onTogglePause: () =>
|
|
499
|
-
onResume: () =>
|
|
619
|
+
busy: be === e.id || T,
|
|
620
|
+
onManage: () => rt(e),
|
|
621
|
+
onTogglePause: () => at(e, e.status === f.Paused ? f.Active : f.Paused),
|
|
622
|
+
onResume: () => at(e, f.Active),
|
|
623
|
+
syncing: we === e.id,
|
|
624
|
+
onSyncNow: () => tt(e.id),
|
|
625
|
+
onReconnectAccount: () => et(e)
|
|
500
626
|
}, e.id))
|
|
501
627
|
})] })]
|
|
502
628
|
}),
|
|
503
629
|
/* @__PURE__ */ N(u, {
|
|
504
|
-
open:
|
|
630
|
+
open: ke,
|
|
505
631
|
onClose: Q,
|
|
506
|
-
title: U ? "Channel connected" :
|
|
507
|
-
description: U ? "Your source can start sending activity to this channel." :
|
|
632
|
+
title: U ? "Channel connected" : I ? `Connect ${g(I).label}` : "Connect a channel",
|
|
633
|
+
description: U ? "Your source can start sending activity to this channel." : I ? "Choose how much this source may store and how long to keep it." : "Pick the kind of source you want to capture from.",
|
|
508
634
|
size: "xl",
|
|
509
635
|
footer: U ? /* @__PURE__ */ N("button", {
|
|
510
636
|
type: "button",
|
|
511
|
-
className:
|
|
637
|
+
className: z,
|
|
512
638
|
onClick: Q,
|
|
513
639
|
children: "Done"
|
|
514
|
-
}) :
|
|
640
|
+
}) : I ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("button", {
|
|
515
641
|
type: "button",
|
|
516
|
-
className:
|
|
517
|
-
onClick: () =>
|
|
642
|
+
className: R,
|
|
643
|
+
onClick: () => V(null),
|
|
518
644
|
children: "Back"
|
|
519
645
|
}), /* @__PURE__ */ N("button", {
|
|
520
646
|
type: "button",
|
|
521
|
-
className:
|
|
522
|
-
onClick:
|
|
523
|
-
disabled:
|
|
524
|
-
children:
|
|
647
|
+
className: z,
|
|
648
|
+
onClick: Ze,
|
|
649
|
+
disabled: C,
|
|
650
|
+
children: C ? "Connecting..." : "Connect"
|
|
525
651
|
})] }) : /* @__PURE__ */ N("button", {
|
|
526
652
|
type: "button",
|
|
527
|
-
className:
|
|
653
|
+
className: R,
|
|
528
654
|
onClick: Q,
|
|
529
655
|
children: "Cancel"
|
|
530
656
|
}),
|
|
531
|
-
children: U ? /* @__PURE__ */ N(
|
|
657
|
+
children: U ? /* @__PURE__ */ N(Ie, {
|
|
532
658
|
channelId: U.id,
|
|
533
659
|
type: U.type
|
|
534
|
-
}) :
|
|
660
|
+
}) : I ? /* @__PURE__ */ P(M, { children: [Be && /* @__PURE__ */ N("div", {
|
|
535
661
|
className: "mb-4 rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-3 text-sm text-status-error-text",
|
|
536
|
-
children:
|
|
537
|
-
}), /* @__PURE__ */ N(
|
|
538
|
-
form:
|
|
539
|
-
onChange:
|
|
662
|
+
children: Be
|
|
663
|
+
}), /* @__PURE__ */ N(Ne, {
|
|
664
|
+
form: Re,
|
|
665
|
+
onChange: ze,
|
|
540
666
|
idPrefix: "connect"
|
|
541
|
-
})] }) : /* @__PURE__ */
|
|
542
|
-
className: "
|
|
543
|
-
children:
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
className: "
|
|
557
|
-
children: e
|
|
558
|
-
|
|
667
|
+
})] }) : /* @__PURE__ */ P("div", {
|
|
668
|
+
className: "space-y-5",
|
|
669
|
+
children: [E.length > 0 && /* @__PURE__ */ P("section", {
|
|
670
|
+
"aria-labelledby": "connect-account-heading",
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ N("h3", {
|
|
673
|
+
id: "connect-account-heading",
|
|
674
|
+
className: "text-sm font-semibold text-text-primary",
|
|
675
|
+
children: "Connect an account"
|
|
676
|
+
}),
|
|
677
|
+
/* @__PURE__ */ N("p", {
|
|
678
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
679
|
+
children: "TimeCampus pulls your activity on a schedule. You sign in with the provider; TimeCampus never sees or stores your password or token."
|
|
680
|
+
}),
|
|
681
|
+
/* @__PURE__ */ N("div", {
|
|
682
|
+
className: "mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
683
|
+
children: E.map((e) => /* @__PURE__ */ P("button", {
|
|
684
|
+
type: "button",
|
|
685
|
+
onClick: () => $e(e),
|
|
686
|
+
"data-testid": `pull-provider-${e.key}`,
|
|
687
|
+
className: "flex items-start gap-3 rounded-lg border border-border-subtle p-3 text-left hover:bg-bg-sunken/50",
|
|
688
|
+
children: [/* @__PURE__ */ N("span", {
|
|
689
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
690
|
+
children: B[e.channelType]
|
|
691
|
+
}), /* @__PURE__ */ P("span", {
|
|
692
|
+
className: "min-w-0",
|
|
693
|
+
children: [/* @__PURE__ */ N("span", {
|
|
694
|
+
className: "block text-sm font-medium text-text-primary",
|
|
695
|
+
children: e.label
|
|
696
|
+
}), /* @__PURE__ */ N("span", {
|
|
697
|
+
className: "block text-xs text-text-secondary",
|
|
698
|
+
children: e.description
|
|
699
|
+
})]
|
|
700
|
+
})]
|
|
701
|
+
}, e.key))
|
|
702
|
+
})
|
|
703
|
+
]
|
|
704
|
+
}), /* @__PURE__ */ P("section", {
|
|
705
|
+
"aria-labelledby": "connect-source-heading",
|
|
706
|
+
children: [/* @__PURE__ */ N("h3", {
|
|
707
|
+
id: "connect-source-heading",
|
|
708
|
+
className: "text-sm font-semibold text-text-primary",
|
|
709
|
+
children: "Add a source that sends activity"
|
|
710
|
+
}), /* @__PURE__ */ N("div", {
|
|
711
|
+
className: "mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
712
|
+
children: ce.map((e) => /* @__PURE__ */ P("button", {
|
|
713
|
+
type: "button",
|
|
714
|
+
onClick: () => Xe(e.type),
|
|
715
|
+
className: "flex items-start gap-3 rounded-lg border border-border-subtle p-3 text-left hover:bg-bg-sunken/50",
|
|
716
|
+
children: [/* @__PURE__ */ N("span", {
|
|
717
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
718
|
+
children: B[e.type]
|
|
719
|
+
}), /* @__PURE__ */ P("span", {
|
|
720
|
+
className: "min-w-0",
|
|
721
|
+
children: [/* @__PURE__ */ N("span", {
|
|
722
|
+
className: "block text-sm font-medium text-text-primary",
|
|
723
|
+
children: e.label
|
|
724
|
+
}), /* @__PURE__ */ N("span", {
|
|
725
|
+
className: "block text-xs text-text-secondary",
|
|
726
|
+
children: e.description
|
|
727
|
+
})]
|
|
728
|
+
})]
|
|
729
|
+
}, e.type))
|
|
559
730
|
})]
|
|
560
|
-
}
|
|
731
|
+
})]
|
|
561
732
|
})
|
|
562
733
|
}),
|
|
734
|
+
/* @__PURE__ */ N(Ae, {
|
|
735
|
+
open: A !== null,
|
|
736
|
+
onClose: () => j(null),
|
|
737
|
+
client: p,
|
|
738
|
+
callbackUrl: fe(l),
|
|
739
|
+
providerKey: A?.provider.integrationProviderKey ?? null,
|
|
740
|
+
providerSource: "catalog",
|
|
741
|
+
requireVault: !1,
|
|
742
|
+
defaultVisibility: "RESTRICTED",
|
|
743
|
+
defaultName: A ? `${A.provider.label} (TimeCampus)` : void 0,
|
|
744
|
+
onConnectionCreated: nt
|
|
745
|
+
}),
|
|
563
746
|
/* @__PURE__ */ N(u, {
|
|
564
747
|
open: G !== null && Y === null,
|
|
565
748
|
onClose: $,
|
|
566
749
|
title: G ? `Manage ${G.name}` : "Manage channel",
|
|
567
|
-
description: G ?
|
|
750
|
+
description: G ? g(G.type).label : void 0,
|
|
568
751
|
size: "xl",
|
|
569
752
|
footer: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("button", {
|
|
570
753
|
type: "button",
|
|
571
|
-
className:
|
|
754
|
+
className: R,
|
|
572
755
|
onClick: $,
|
|
573
756
|
children: "Cancel"
|
|
574
757
|
}), /* @__PURE__ */ N("button", {
|
|
575
758
|
type: "button",
|
|
576
|
-
className:
|
|
577
|
-
onClick:
|
|
578
|
-
disabled:
|
|
579
|
-
children:
|
|
759
|
+
className: z,
|
|
760
|
+
onClick: it,
|
|
761
|
+
disabled: T,
|
|
762
|
+
children: T ? "Saving..." : "Save changes"
|
|
580
763
|
})] }),
|
|
581
764
|
children: G && K && /* @__PURE__ */ P("div", {
|
|
582
765
|
className: "space-y-6",
|
|
583
766
|
children: [
|
|
584
|
-
|
|
767
|
+
He && /* @__PURE__ */ N("div", {
|
|
585
768
|
className: "rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-3 text-sm text-status-error-text",
|
|
586
|
-
children:
|
|
769
|
+
children: He
|
|
587
770
|
}),
|
|
588
|
-
/* @__PURE__ */ N(
|
|
771
|
+
/* @__PURE__ */ N(Ne, {
|
|
589
772
|
form: K,
|
|
590
773
|
onChange: q,
|
|
591
|
-
idPrefix: "manage"
|
|
774
|
+
idPrefix: "manage",
|
|
775
|
+
pullMinInterval: G.pullSync ? Qe(G)?.minSyncIntervalMinutes ?? 1 : void 0
|
|
592
776
|
}),
|
|
593
|
-
/* @__PURE__ */ N(
|
|
777
|
+
!G.pullSync && /* @__PURE__ */ N(Ie, {
|
|
594
778
|
channelId: G.id,
|
|
595
779
|
type: G.type
|
|
596
780
|
}),
|
|
@@ -610,30 +794,30 @@ function H() {
|
|
|
610
794
|
children: [
|
|
611
795
|
G.status !== f.Disconnected && /* @__PURE__ */ P("button", {
|
|
612
796
|
type: "button",
|
|
613
|
-
className:
|
|
797
|
+
className: R,
|
|
614
798
|
onClick: () => X({
|
|
615
799
|
kind: "disconnect",
|
|
616
800
|
channel: G
|
|
617
801
|
}),
|
|
618
|
-
children: [/* @__PURE__ */ N(
|
|
802
|
+
children: [/* @__PURE__ */ N(Ee, { className: "h-4 w-4" }), "Disconnect"]
|
|
619
803
|
}),
|
|
620
804
|
/* @__PURE__ */ P("button", {
|
|
621
805
|
type: "button",
|
|
622
|
-
className:
|
|
806
|
+
className: R,
|
|
623
807
|
onClick: () => X({
|
|
624
808
|
kind: "purge",
|
|
625
809
|
channel: G
|
|
626
810
|
}),
|
|
627
|
-
children: [/* @__PURE__ */ N(
|
|
811
|
+
children: [/* @__PURE__ */ N(Te, { className: "h-4 w-4" }), "Delete captured data"]
|
|
628
812
|
}),
|
|
629
813
|
/* @__PURE__ */ P("button", {
|
|
630
814
|
type: "button",
|
|
631
|
-
className:
|
|
815
|
+
className: je,
|
|
632
816
|
onClick: () => X({
|
|
633
817
|
kind: "remove",
|
|
634
818
|
channel: G
|
|
635
819
|
}),
|
|
636
|
-
children: [/* @__PURE__ */ N(
|
|
820
|
+
children: [/* @__PURE__ */ N(Te, { className: "h-4 w-4" }), "Remove channel"]
|
|
637
821
|
})
|
|
638
822
|
]
|
|
639
823
|
})
|
|
@@ -648,33 +832,33 @@ function H() {
|
|
|
648
832
|
title: Y?.kind === "disconnect" ? "Disconnect channel?" : Y?.kind === "purge" ? "Delete captured data?" : "Remove channel?",
|
|
649
833
|
footer: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("button", {
|
|
650
834
|
type: "button",
|
|
651
|
-
className:
|
|
835
|
+
className: R,
|
|
652
836
|
onClick: () => X(null),
|
|
653
837
|
children: "Cancel"
|
|
654
838
|
}), /* @__PURE__ */ N("button", {
|
|
655
839
|
type: "button",
|
|
656
|
-
className: Y?.kind === "disconnect" ?
|
|
657
|
-
onClick:
|
|
658
|
-
disabled:
|
|
659
|
-
children:
|
|
840
|
+
className: Y?.kind === "disconnect" ? z : je,
|
|
841
|
+
onClick: ot,
|
|
842
|
+
disabled: Ue,
|
|
843
|
+
children: Ue ? "Working..." : Y?.kind === "disconnect" ? "Disconnect" : Y?.kind === "purge" ? "Delete data" : "Remove"
|
|
660
844
|
})] }),
|
|
661
845
|
children: /* @__PURE__ */ P("p", {
|
|
662
846
|
className: "text-sm text-text-secondary",
|
|
663
847
|
children: [
|
|
664
|
-
Y?.kind === "disconnect" && `${Y.channel.name} will stop capturing. Anything it sends is refused until you reconnect it. Captured events are kept
|
|
848
|
+
Y?.kind === "disconnect" && (Y.channel.pullSync ? `${Y.channel.name} will stop syncing and TimeCampus's access to the account is revoked. Captured events are kept; connect the account again to resume.` : `${Y.channel.name} will stop capturing. Anything it sends is refused until you reconnect it. Captured events are kept.`),
|
|
665
849
|
Y?.kind === "purge" && `Every event captured by ${Y.channel.name} will be permanently deleted from your timeline. This cannot be undone.`,
|
|
666
|
-
Y?.kind === "remove" && `${Y.channel.name} will be removed and its ID refused from now on. Events it already captured stay on your timeline unless you delete them first.`
|
|
850
|
+
Y?.kind === "remove" && `${Y.channel.name} will be removed and its ID refused from now on.${Y.channel.pullSync ? " TimeCampus's access to the account is revoked." : ""} Events it already captured stay on your timeline unless you delete them first.`
|
|
667
851
|
]
|
|
668
852
|
})
|
|
669
853
|
}),
|
|
670
|
-
/* @__PURE__ */ N(
|
|
671
|
-
toasts:
|
|
672
|
-
onDismiss:
|
|
854
|
+
/* @__PURE__ */ N(oe, {
|
|
855
|
+
toasts: m,
|
|
856
|
+
onDismiss: le
|
|
673
857
|
})
|
|
674
858
|
]
|
|
675
859
|
});
|
|
676
860
|
}
|
|
677
861
|
//#endregion
|
|
678
|
-
export {
|
|
862
|
+
export { V as ChannelsPage };
|
|
679
863
|
|
|
680
864
|
//# sourceMappingURL=ChannelsPage.js.map
|