@burdenoff/microfe-integrations 2026.625.2 → 2026.625.4
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/integrations/components/ConnectionStatusBadge.js +1 -1
- package/dist/integrations/components/ConnectionStatusBadge.js.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +258 -256
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +187 -152
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.js +43 -55
- package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +66 -79
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +101 -81
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.js +52 -48
- package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +94 -106
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.js +211 -190
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.js +147 -143
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -6,20 +6,20 @@ import { useState as a } from "react";
|
|
|
6
6
|
import { ArrowLeft as o, Check as s, CheckCircle2 as c, Clock as l, Copy as u, Globe as d, Loader2 as f, Save as p, Settings as m, Shield as h } from "lucide-react";
|
|
7
7
|
import { useI18n as g, usePermissions as _ } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
8
8
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
9
|
-
import { Button as b, EmphasisPanel as x, GlassCard as S } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
import { Button as b, EmphasisPanel as x, GlassCard as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
|
|
10
10
|
//#region src/integrations/pages/IntegrationsSettings.tsx
|
|
11
|
-
function
|
|
12
|
-
let { basePath:
|
|
13
|
-
let r =
|
|
11
|
+
function w() {
|
|
12
|
+
let { basePath: w = "/", navigate: T, apiGatewayUrl: E } = e(), { t: D } = g(), O = (e, t, n) => {
|
|
13
|
+
let r = D(e, n);
|
|
14
14
|
return r === e ? n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)).replace(`{${t}}`, String(n)), t) : t : r;
|
|
15
|
-
}, { hasPermission:
|
|
16
|
-
return
|
|
15
|
+
}, { hasPermission: k, isLoading: A } = _(), j = k(n.INTEGRATION_WRITE), [M, N] = a(30), [P, F] = a(60), [I, L] = a(!0), [R, z] = a(!1), [B, V] = a(!1), [H, U] = a(!1), W = E ? `${E}/integrations/oauth/callback` : `${typeof window < "u" ? window.location.origin : ""}/integrations/oauth/callback`;
|
|
16
|
+
return A ? /* @__PURE__ */ v("div", {
|
|
17
17
|
className: "flex items-center justify-center py-20",
|
|
18
18
|
children: /* @__PURE__ */ v(f, {
|
|
19
19
|
size: 48,
|
|
20
20
|
className: "animate-spin text-primary"
|
|
21
21
|
})
|
|
22
|
-
}) :
|
|
22
|
+
}) : j ? /* @__PURE__ */ y("div", {
|
|
23
23
|
className: "space-y-6 p-6 max-w-4xl mx-auto",
|
|
24
24
|
children: [
|
|
25
25
|
/* @__PURE__ */ v("div", {
|
|
@@ -30,8 +30,8 @@ function C() {
|
|
|
30
30
|
/* @__PURE__ */ v(b, {
|
|
31
31
|
variant: "ghost",
|
|
32
32
|
size: "icon",
|
|
33
|
-
onClick: () =>
|
|
34
|
-
"aria-label":
|
|
33
|
+
onClick: () => T?.(w),
|
|
34
|
+
"aria-label": O("integrations.settings.actions.backAriaLabel", "Back"),
|
|
35
35
|
children: /* @__PURE__ */ v(o, { size: 20 })
|
|
36
36
|
}),
|
|
37
37
|
/* @__PURE__ */ v("div", {
|
|
@@ -43,14 +43,18 @@ function C() {
|
|
|
43
43
|
}),
|
|
44
44
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
45
45
|
className: "text-2xl sm:text-3xl font-bold text-text-primary",
|
|
46
|
-
children:
|
|
46
|
+
children: O("integrations.settings.title", "Integrations Settings")
|
|
47
47
|
}), /* @__PURE__ */ v("p", {
|
|
48
48
|
className: "text-sm text-text-secondary mt-0.5",
|
|
49
|
-
children:
|
|
49
|
+
children: O("integrations.settings.subtitle", "Configure integration module behavior")
|
|
50
50
|
})] })
|
|
51
51
|
]
|
|
52
52
|
})
|
|
53
53
|
}),
|
|
54
|
+
/* @__PURE__ */ v(C, {
|
|
55
|
+
icon: /* @__PURE__ */ v(m, { size: 16 }),
|
|
56
|
+
children: O("integrations.settings.purpose", "These workspace-wide settings govern how every integration behaves. Copy the OAuth redirect URI to paste into a provider’s app configuration, set how long connection requests may take, control how often health checks run, and decide whether OAuth tokens refresh automatically before they expire.")
|
|
57
|
+
}),
|
|
54
58
|
/* @__PURE__ */ y(x, {
|
|
55
59
|
className: "space-y-4",
|
|
56
60
|
children: [/* @__PURE__ */ y("h2", {
|
|
@@ -58,36 +62,36 @@ function C() {
|
|
|
58
62
|
children: [/* @__PURE__ */ v(d, {
|
|
59
63
|
size: 18,
|
|
60
64
|
className: "text-primary"
|
|
61
|
-
}),
|
|
65
|
+
}), O("integrations.settings.oauth.title", "OAuth Configuration")]
|
|
62
66
|
}), /* @__PURE__ */ y("div", {
|
|
63
67
|
className: "space-y-2",
|
|
64
68
|
children: [
|
|
65
69
|
/* @__PURE__ */ v("label", {
|
|
66
70
|
className: "block text-sm font-medium text-text-primary",
|
|
67
|
-
children:
|
|
71
|
+
children: O("integrations.settings.oauth.redirectUriLabel", "Default OAuth Redirect URI")
|
|
68
72
|
}),
|
|
69
73
|
/* @__PURE__ */ v("p", {
|
|
70
74
|
className: "text-xs text-text-secondary mb-2",
|
|
71
|
-
children:
|
|
75
|
+
children: O("integrations.settings.oauth.redirectUriDescription", "Use this URL as the redirect/callback URI when configuring OAuth applications with providers.")
|
|
72
76
|
}),
|
|
73
77
|
/* @__PURE__ */ y("div", {
|
|
74
78
|
className: "flex items-center gap-2",
|
|
75
79
|
children: [/* @__PURE__ */ v("div", {
|
|
76
80
|
className: "flex-1 px-4 py-2.5 border border-border-seam rounded-lg bg-bg-sunken/30 font-mono text-sm text-text-primary break-all",
|
|
77
|
-
children:
|
|
81
|
+
children: W
|
|
78
82
|
}), /* @__PURE__ */ v(b, {
|
|
79
83
|
variant: "outline",
|
|
80
84
|
size: "icon",
|
|
81
85
|
onClick: async () => {
|
|
82
|
-
if (i("light"), !await r(
|
|
86
|
+
if (i("light"), !await r(W)) {
|
|
83
87
|
let e = document.createElement("input");
|
|
84
|
-
e.value =
|
|
88
|
+
e.value = W, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
85
89
|
}
|
|
86
|
-
|
|
90
|
+
U(!0), setTimeout(() => U(!1), 2e3);
|
|
87
91
|
},
|
|
88
92
|
className: "flex-shrink-0",
|
|
89
|
-
"aria-label":
|
|
90
|
-
children:
|
|
93
|
+
"aria-label": O("integrations.settings.oauth.copyAriaLabel", "Copy redirect URI"),
|
|
94
|
+
children: H ? /* @__PURE__ */ v(s, {
|
|
91
95
|
size: 16,
|
|
92
96
|
className: "text-status-success-text"
|
|
93
97
|
}) : /* @__PURE__ */ v(u, { size: 16 })
|
|
@@ -103,47 +107,47 @@ function C() {
|
|
|
103
107
|
children: [/* @__PURE__ */ v(l, {
|
|
104
108
|
size: 18,
|
|
105
109
|
className: "text-primary"
|
|
106
|
-
}),
|
|
110
|
+
}), O("integrations.settings.connection.title", "Connection Settings")]
|
|
107
111
|
}), /* @__PURE__ */ y("div", {
|
|
108
112
|
className: "space-y-4",
|
|
109
113
|
children: [/* @__PURE__ */ y("div", { children: [
|
|
110
114
|
/* @__PURE__ */ v("label", {
|
|
111
115
|
htmlFor: "conn-timeout",
|
|
112
116
|
className: "block text-sm font-semibold mb-2",
|
|
113
|
-
children:
|
|
117
|
+
children: O("integrations.settings.connection.timeoutLabel", "Connection Timeout (seconds)")
|
|
114
118
|
}),
|
|
115
119
|
/* @__PURE__ */ v("p", {
|
|
116
120
|
className: "text-xs text-text-secondary mb-2",
|
|
117
|
-
children:
|
|
121
|
+
children: O("integrations.settings.connection.timeoutDescription", "Maximum time to wait when testing or using a connection.")
|
|
118
122
|
}),
|
|
119
123
|
/* @__PURE__ */ v("input", {
|
|
120
124
|
type: "number",
|
|
121
125
|
id: "conn-timeout",
|
|
122
|
-
value:
|
|
123
|
-
onChange: (e) =>
|
|
126
|
+
value: M,
|
|
127
|
+
onChange: (e) => N(Number(e.target.value)),
|
|
124
128
|
min: 5,
|
|
125
129
|
max: 120,
|
|
126
|
-
"aria-label":
|
|
130
|
+
"aria-label": O("integrations.settings.connection.timeoutLabel", "Connection Timeout (seconds)"),
|
|
127
131
|
className: "w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
128
132
|
})
|
|
129
133
|
] }), /* @__PURE__ */ y("div", { children: [
|
|
130
134
|
/* @__PURE__ */ v("label", {
|
|
131
135
|
htmlFor: "health-interval",
|
|
132
136
|
className: "block text-sm font-semibold mb-2",
|
|
133
|
-
children:
|
|
137
|
+
children: O("integrations.settings.connection.healthCheckLabel", "Health Check Interval (minutes)")
|
|
134
138
|
}),
|
|
135
139
|
/* @__PURE__ */ v("p", {
|
|
136
140
|
className: "text-xs text-text-secondary mb-2",
|
|
137
|
-
children:
|
|
141
|
+
children: O("integrations.settings.connection.healthCheckDescription", "How often to automatically check connection health.")
|
|
138
142
|
}),
|
|
139
143
|
/* @__PURE__ */ v("input", {
|
|
140
144
|
type: "number",
|
|
141
145
|
id: "health-interval",
|
|
142
|
-
value:
|
|
143
|
-
onChange: (e) =>
|
|
146
|
+
value: P,
|
|
147
|
+
onChange: (e) => F(Number(e.target.value)),
|
|
144
148
|
min: 5,
|
|
145
149
|
max: 1440,
|
|
146
|
-
"aria-label":
|
|
150
|
+
"aria-label": O("integrations.settings.connection.healthCheckLabel", "Health Check Interval (minutes)"),
|
|
147
151
|
className: "w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
148
152
|
})
|
|
149
153
|
] })]
|
|
@@ -156,7 +160,7 @@ function C() {
|
|
|
156
160
|
children: [/* @__PURE__ */ v(h, {
|
|
157
161
|
size: 18,
|
|
158
162
|
className: "text-primary"
|
|
159
|
-
}),
|
|
163
|
+
}), O("integrations.settings.security.title", "Security")]
|
|
160
164
|
}), /* @__PURE__ */ v("div", {
|
|
161
165
|
className: "space-y-4",
|
|
162
166
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -164,19 +168,19 @@ function C() {
|
|
|
164
168
|
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
165
169
|
htmlFor: "auto-refresh",
|
|
166
170
|
className: "text-sm font-semibold text-text-primary",
|
|
167
|
-
children:
|
|
171
|
+
children: O("integrations.settings.security.autoRefreshLabel", "Auto-refresh OAuth Tokens")
|
|
168
172
|
}), /* @__PURE__ */ v("p", {
|
|
169
173
|
className: "text-xs text-text-secondary mt-0.5",
|
|
170
|
-
children:
|
|
174
|
+
children: O("integrations.settings.security.autoRefreshDescription", "Automatically refresh tokens before they expire.")
|
|
171
175
|
})] }), /* @__PURE__ */ v("button", {
|
|
172
176
|
type: "button",
|
|
173
177
|
id: "auto-refresh",
|
|
174
178
|
role: "switch",
|
|
175
|
-
"aria-checked":
|
|
176
|
-
"aria-label":
|
|
177
|
-
onClick: () =>
|
|
178
|
-
className: t("relative w-11 h-6 rounded-full transition-colors flex-shrink-0",
|
|
179
|
-
children: /* @__PURE__ */ v("span", { className: t("absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform",
|
|
179
|
+
"aria-checked": I,
|
|
180
|
+
"aria-label": O("integrations.settings.security.autoRefreshLabel", "Auto-refresh OAuth Tokens"),
|
|
181
|
+
onClick: () => L(!I),
|
|
182
|
+
className: t("relative w-11 h-6 rounded-full transition-colors flex-shrink-0", I ? "bg-action-primary-bg" : "bg-bg-sunken"),
|
|
183
|
+
children: /* @__PURE__ */ v("span", { className: t("absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform", I && "translate-x-5") })
|
|
180
184
|
})]
|
|
181
185
|
})
|
|
182
186
|
})]
|
|
@@ -186,13 +190,13 @@ function C() {
|
|
|
186
190
|
children: /* @__PURE__ */ y(b, {
|
|
187
191
|
size: "lg",
|
|
188
192
|
onClick: async () => {
|
|
189
|
-
|
|
193
|
+
z(!0), await new Promise((e) => setTimeout(e, 1e3)), z(!1), V(!0), setTimeout(() => V(!1), 3e3);
|
|
190
194
|
},
|
|
191
|
-
disabled:
|
|
192
|
-
children: [
|
|
195
|
+
disabled: R,
|
|
196
|
+
children: [R ? /* @__PURE__ */ v(f, {
|
|
193
197
|
size: 16,
|
|
194
198
|
className: "animate-spin"
|
|
195
|
-
}) : v(
|
|
199
|
+
}) : v(B ? c : p, { size: 16 }), R ? O("integrations.settings.actions.saving", "Saving...") : B ? O("integrations.settings.actions.saved", "Saved!") : O("integrations.settings.actions.save", "Save Settings")]
|
|
196
200
|
})
|
|
197
201
|
})
|
|
198
202
|
]
|
|
@@ -205,25 +209,25 @@ function C() {
|
|
|
205
209
|
}),
|
|
206
210
|
/* @__PURE__ */ v("h2", {
|
|
207
211
|
className: "text-xl font-bold text-text-primary mb-2",
|
|
208
|
-
children:
|
|
212
|
+
children: O("integrations.settings.accessDenied.title", "Access Denied")
|
|
209
213
|
}),
|
|
210
214
|
/* @__PURE__ */ v("p", {
|
|
211
215
|
className: "text-sm text-text-secondary mb-6 max-w-sm",
|
|
212
|
-
children:
|
|
216
|
+
children: O("integrations.settings.accessDenied.description", "You don't have permission to manage integration settings.")
|
|
213
217
|
}),
|
|
214
218
|
/* @__PURE__ */ y(b, {
|
|
215
219
|
variant: "outline",
|
|
216
|
-
onClick: () =>
|
|
220
|
+
onClick: () => T?.(w),
|
|
217
221
|
children: [
|
|
218
222
|
/* @__PURE__ */ v(o, { size: 16 }),
|
|
219
223
|
" ",
|
|
220
|
-
|
|
224
|
+
O("integrations.settings.accessDenied.back", "Back to Overview")
|
|
221
225
|
]
|
|
222
226
|
})
|
|
223
227
|
]
|
|
224
228
|
});
|
|
225
229
|
}
|
|
226
230
|
//#endregion
|
|
227
|
-
export {
|
|
231
|
+
export { w as IntegrationsSettings };
|
|
228
232
|
|
|
229
233
|
//# sourceMappingURL=IntegrationsSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsSettings.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsSettings.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Settings,\n ArrowLeft,\n Globe,\n Clock,\n Shield,\n Save,\n Loader2,\n CheckCircle2,\n Copy,\n Check,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Button, GlassCard, EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { nativeCopyText, nativeImpact } from '../../utils/nativeBridge';\n\n/**\n * Integrations Settings — module configuration page.\n */\nexport function IntegrationsSettings() {\n const { basePath = '/', navigate, apiGatewayUrl } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canWrite = hasPermission(INTEGRATION_PERMISSIONS.INTEGRATION_WRITE);\n\n const [connectionTimeout, setConnectionTimeout] = useState(30);\n const [healthCheckInterval, setHealthCheckInterval] = useState(60);\n const [autoRefreshTokens, setAutoRefreshTokens] = useState(true);\n const [saving, setSaving] = useState(false);\n const [saved, setSaved] = useState(false);\n const [copiedRedirectUri, setCopiedRedirectUri] = useState(false);\n\n // Compute the default OAuth redirect URI based on the gateway URL\n const oauthRedirectUri = apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : `${typeof window !== 'undefined' ? window.location.origin : ''}/integrations/oauth/callback`;\n\n const handleSave = async () => {\n setSaving(true);\n // Simulated save — in production this would call a GraphQL mutation\n await new Promise((resolve) => setTimeout(resolve, 1000));\n setSaving(false);\n setSaved(true);\n setTimeout(() => setSaved(false), 3000);\n };\n\n const handleCopyRedirectUri = async () => {\n void nativeImpact('light');\n const ok = await nativeCopyText(oauthRedirectUri);\n if (!ok) {\n // Last-resort fallback for very old browsers without clipboard or execCommand support\n const input = document.createElement('input');\n input.value = oauthRedirectUri;\n document.body.appendChild(input);\n input.select();\n document.execCommand('copy');\n document.body.removeChild(input);\n }\n setCopiedRedirectUri(true);\n setTimeout(() => setCopiedRedirectUri(false), 2000);\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!canWrite) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <Shield size={48} className=\"text-text-secondary mb-4\" />\n <h2 className=\"text-xl font-bold text-text-primary mb-2\">\n {tx('integrations.settings.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-6 max-w-sm\">\n {tx(\n 'integrations.settings.accessDenied.description',\n \"You don't have permission to manage integration settings.\"\n )}\n </p>\n <Button variant=\"outline\" onClick={() => navigate?.(basePath)}>\n <ArrowLeft size={16} />{' '}\n {tx('integrations.settings.accessDenied.back', 'Back to Overview')}\n </Button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl mx-auto\">\n {/* Header */}\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6\">\n <div className=\"flex items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => navigate?.(basePath)}\n aria-label={tx('integrations.settings.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Settings size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tx('integrations.settings.title', 'Integrations Settings')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx('integrations.settings.subtitle', 'Configure integration module behavior')}\n </p>\n </div>\n </div>\n </div>\n\n {/* OAuth Redirect URI */}\n <EmphasisPanel className=\"space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Globe size={18} className=\"text-primary\" />\n {tx('integrations.settings.oauth.title', 'OAuth Configuration')}\n </h2>\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-text-primary\">\n {tx('integrations.settings.oauth.redirectUriLabel', 'Default OAuth Redirect URI')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.oauth.redirectUriDescription',\n 'Use this URL as the redirect/callback URI when configuring OAuth applications with providers.'\n )}\n </p>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 px-4 py-2.5 border border-border-seam rounded-lg bg-bg-sunken/30 font-mono text-sm text-text-primary break-all\">\n {oauthRedirectUri}\n </div>\n <Button\n variant=\"outline\"\n size=\"icon\"\n onClick={handleCopyRedirectUri}\n className=\"flex-shrink-0\"\n aria-label={tx('integrations.settings.oauth.copyAriaLabel', 'Copy redirect URI')}\n >\n {copiedRedirectUri ? (\n <Check size={16} className=\"text-status-success-text\" />\n ) : (\n <Copy size={16} />\n )}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n {/* Connection Settings */}\n <GlassCard className=\"border-border-seam p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Clock size={18} className=\"text-primary\" />\n {tx('integrations.settings.connection.title', 'Connection Settings')}\n </h2>\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"conn-timeout\" className=\"block text-sm font-semibold mb-2\">\n {tx('integrations.settings.connection.timeoutLabel', 'Connection Timeout (seconds)')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.connection.timeoutDescription',\n 'Maximum time to wait when testing or using a connection.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"conn-timeout\"\n value={connectionTimeout}\n onChange={(e) => setConnectionTimeout(Number(e.target.value))}\n min={5}\n max={120}\n aria-label={tx(\n 'integrations.settings.connection.timeoutLabel',\n 'Connection Timeout (seconds)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n <div>\n <label htmlFor=\"health-interval\" className=\"block text-sm font-semibold mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckDescription',\n 'How often to automatically check connection health.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"health-interval\"\n value={healthCheckInterval}\n onChange={(e) => setHealthCheckInterval(Number(e.target.value))}\n min={5}\n max={1440}\n aria-label={tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n </div>\n </GlassCard>\n\n {/* Security Settings */}\n <GlassCard className=\"border-border-seam p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.settings.security.title', 'Security')}\n </h2>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <label htmlFor=\"auto-refresh\" className=\"text-sm font-semibold text-text-primary\">\n {tx('integrations.settings.security.autoRefreshLabel', 'Auto-refresh OAuth Tokens')}\n </label>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tx(\n 'integrations.settings.security.autoRefreshDescription',\n 'Automatically refresh tokens before they expire.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n id=\"auto-refresh\"\n role=\"switch\"\n aria-checked={autoRefreshTokens}\n aria-label={tx(\n 'integrations.settings.security.autoRefreshLabel',\n 'Auto-refresh OAuth Tokens'\n )}\n onClick={() => setAutoRefreshTokens(!autoRefreshTokens)}\n className={cn(\n 'relative w-11 h-6 rounded-full transition-colors flex-shrink-0',\n autoRefreshTokens ? 'bg-action-primary-bg' : 'bg-bg-sunken'\n )}\n >\n <span\n className={cn(\n 'absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform',\n autoRefreshTokens && 'translate-x-5'\n )}\n />\n </button>\n </div>\n </div>\n </GlassCard>\n\n {/* Save Button */}\n <div className=\"flex items-center gap-3\">\n <Button size=\"lg\" onClick={handleSave} disabled={saving}>\n {saving ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : saved ? (\n <CheckCircle2 size={16} />\n ) : (\n <Save size={16} />\n )}\n {saving\n ? tx('integrations.settings.actions.saving', 'Saving...')\n : saved\n ? tx('integrations.settings.actions.saved', 'Saved!')\n : tx('integrations.settings.actions.save', 'Save Settings')}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAuBA,SAAgB,IAAuB;CACrC,IAAM,EAAE,cAAW,KAAK,aAAU,qBAAkB,GAAiB,E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../../src/integrations/pages/IntegrationsSettings.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Settings,\n ArrowLeft,\n Globe,\n Clock,\n Shield,\n Save,\n Loader2,\n CheckCircle2,\n Copy,\n Check,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Button, GlassCard, EmphasisPanel, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { nativeCopyText, nativeImpact } from '../../utils/nativeBridge';\n\n/**\n * Integrations Settings — module configuration page.\n */\nexport function IntegrationsSettings() {\n const { basePath = '/', navigate, apiGatewayUrl } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canWrite = hasPermission(INTEGRATION_PERMISSIONS.INTEGRATION_WRITE);\n\n const [connectionTimeout, setConnectionTimeout] = useState(30);\n const [healthCheckInterval, setHealthCheckInterval] = useState(60);\n const [autoRefreshTokens, setAutoRefreshTokens] = useState(true);\n const [saving, setSaving] = useState(false);\n const [saved, setSaved] = useState(false);\n const [copiedRedirectUri, setCopiedRedirectUri] = useState(false);\n\n // Compute the default OAuth redirect URI based on the gateway URL\n const oauthRedirectUri = apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : `${typeof window !== 'undefined' ? window.location.origin : ''}/integrations/oauth/callback`;\n\n const handleSave = async () => {\n setSaving(true);\n // Simulated save — in production this would call a GraphQL mutation\n await new Promise((resolve) => setTimeout(resolve, 1000));\n setSaving(false);\n setSaved(true);\n setTimeout(() => setSaved(false), 3000);\n };\n\n const handleCopyRedirectUri = async () => {\n void nativeImpact('light');\n const ok = await nativeCopyText(oauthRedirectUri);\n if (!ok) {\n // Last-resort fallback for very old browsers without clipboard or execCommand support\n const input = document.createElement('input');\n input.value = oauthRedirectUri;\n document.body.appendChild(input);\n input.select();\n document.execCommand('copy');\n document.body.removeChild(input);\n }\n setCopiedRedirectUri(true);\n setTimeout(() => setCopiedRedirectUri(false), 2000);\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!canWrite) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <Shield size={48} className=\"text-text-secondary mb-4\" />\n <h2 className=\"text-xl font-bold text-text-primary mb-2\">\n {tx('integrations.settings.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-6 max-w-sm\">\n {tx(\n 'integrations.settings.accessDenied.description',\n \"You don't have permission to manage integration settings.\"\n )}\n </p>\n <Button variant=\"outline\" onClick={() => navigate?.(basePath)}>\n <ArrowLeft size={16} />{' '}\n {tx('integrations.settings.accessDenied.back', 'Back to Overview')}\n </Button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl mx-auto\">\n {/* Header */}\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6\">\n <div className=\"flex items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => navigate?.(basePath)}\n aria-label={tx('integrations.settings.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Settings size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tx('integrations.settings.title', 'Integrations Settings')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx('integrations.settings.subtitle', 'Configure integration module behavior')}\n </p>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Settings size={16} />}>\n {tx(\n 'integrations.settings.purpose',\n 'These workspace-wide settings govern how every integration behaves. Copy the OAuth redirect URI to paste into a provider’s app configuration, set how long connection requests may take, control how often health checks run, and decide whether OAuth tokens refresh automatically before they expire.'\n )}\n </PagePurpose>\n\n {/* OAuth Redirect URI */}\n <EmphasisPanel className=\"space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Globe size={18} className=\"text-primary\" />\n {tx('integrations.settings.oauth.title', 'OAuth Configuration')}\n </h2>\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-text-primary\">\n {tx('integrations.settings.oauth.redirectUriLabel', 'Default OAuth Redirect URI')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.oauth.redirectUriDescription',\n 'Use this URL as the redirect/callback URI when configuring OAuth applications with providers.'\n )}\n </p>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 px-4 py-2.5 border border-border-seam rounded-lg bg-bg-sunken/30 font-mono text-sm text-text-primary break-all\">\n {oauthRedirectUri}\n </div>\n <Button\n variant=\"outline\"\n size=\"icon\"\n onClick={handleCopyRedirectUri}\n className=\"flex-shrink-0\"\n aria-label={tx('integrations.settings.oauth.copyAriaLabel', 'Copy redirect URI')}\n >\n {copiedRedirectUri ? (\n <Check size={16} className=\"text-status-success-text\" />\n ) : (\n <Copy size={16} />\n )}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n {/* Connection Settings */}\n <GlassCard className=\"border-border-seam p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Clock size={18} className=\"text-primary\" />\n {tx('integrations.settings.connection.title', 'Connection Settings')}\n </h2>\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"conn-timeout\" className=\"block text-sm font-semibold mb-2\">\n {tx('integrations.settings.connection.timeoutLabel', 'Connection Timeout (seconds)')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.connection.timeoutDescription',\n 'Maximum time to wait when testing or using a connection.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"conn-timeout\"\n value={connectionTimeout}\n onChange={(e) => setConnectionTimeout(Number(e.target.value))}\n min={5}\n max={120}\n aria-label={tx(\n 'integrations.settings.connection.timeoutLabel',\n 'Connection Timeout (seconds)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n <div>\n <label htmlFor=\"health-interval\" className=\"block text-sm font-semibold mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckDescription',\n 'How often to automatically check connection health.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"health-interval\"\n value={healthCheckInterval}\n onChange={(e) => setHealthCheckInterval(Number(e.target.value))}\n min={5}\n max={1440}\n aria-label={tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n </div>\n </GlassCard>\n\n {/* Security Settings */}\n <GlassCard className=\"border-border-seam p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.settings.security.title', 'Security')}\n </h2>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <label htmlFor=\"auto-refresh\" className=\"text-sm font-semibold text-text-primary\">\n {tx('integrations.settings.security.autoRefreshLabel', 'Auto-refresh OAuth Tokens')}\n </label>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tx(\n 'integrations.settings.security.autoRefreshDescription',\n 'Automatically refresh tokens before they expire.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n id=\"auto-refresh\"\n role=\"switch\"\n aria-checked={autoRefreshTokens}\n aria-label={tx(\n 'integrations.settings.security.autoRefreshLabel',\n 'Auto-refresh OAuth Tokens'\n )}\n onClick={() => setAutoRefreshTokens(!autoRefreshTokens)}\n className={cn(\n 'relative w-11 h-6 rounded-full transition-colors flex-shrink-0',\n autoRefreshTokens ? 'bg-action-primary-bg' : 'bg-bg-sunken'\n )}\n >\n <span\n className={cn(\n 'absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform',\n autoRefreshTokens && 'translate-x-5'\n )}\n />\n </button>\n </div>\n </div>\n </GlassCard>\n\n {/* Save Button */}\n <div className=\"flex items-center gap-3\">\n <Button size=\"lg\" onClick={handleSave} disabled={saving}>\n {saving ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : saved ? (\n <CheckCircle2 size={16} />\n ) : (\n <Save size={16} />\n )}\n {saving\n ? tx('integrations.settings.actions.saving', 'Saving...')\n : saved\n ? tx('integrations.settings.actions.saved', 'Saved!')\n : tx('integrations.settings.actions.save', 'Save Settings')}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAuBA,SAAgB,IAAuB;CACrC,IAAM,EAAE,cAAW,KAAK,aAAU,qBAAkB,GAAiB,EAC/D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,GAAkB,MAA6C;EACtF,IAAM,IAAa,EAAE,GAAK,EAAO;AAIjC,SAHI,MAAe,IACd,IAEE,OAAO,QAAQ,EAAO,CAAC,QAC3B,GAAO,CAAC,GAAU,OACjB,EACG,QAAQ,KAAK,EAAS,KAAK,OAAO,EAAW,CAAC,CAC9C,QAAQ,IAAI,EAAS,IAAI,OAAO,EAAW,CAAC,EACjD,EACD,GARmB,IADW;IAW3B,EAAE,kBAA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