@burdenoff/fe-libs 2026.1119.8 → 2026.1119.9
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/connections/ConnectionDialogPanel.js +222 -203
- package/dist/connections/ConnectionFormTab.d.ts +6 -0
- package/dist/connections/ConnectionFormTab.js +2 -2
- package/dist/connections/api.d.ts +28 -0
- package/dist/connections/api.js +107 -71
- package/dist/connections/connectionFlow.d.ts +63 -1
- package/dist/connections/connectionFlow.js +139 -47
- package/dist/connections/index.d.ts +2 -2
- package/dist/connections/oauthPopup.d.ts +16 -1
- package/dist/connections/oauthPopup.js +45 -37
- package/dist/connections/useConnectionSubmit.d.ts +7 -2
- package/dist/connections/useConnectionSubmit.js +69 -55
- package/dist/connections.js +6 -6
- package/package.json +1 -1
|
@@ -21,25 +21,28 @@ function p(e) {
|
|
|
21
21
|
let t = window.screenX + (window.innerWidth - d) / 2, n = window.screenY + (window.innerHeight - f) / 2;
|
|
22
22
|
return window.open(e, "oauth_popup", `width=${d},height=${f},left=${t},top=${n},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);
|
|
23
23
|
}
|
|
24
|
-
function m({ api: e, callbackUrl: d, translate: f, onConnectionCreated: m, onError: h, onEvent: g, reconnectConnection: _ }) {
|
|
25
|
-
let [
|
|
26
|
-
a(() =>
|
|
27
|
-
|
|
24
|
+
function m({ api: e, callbackUrl: d, translate: f, onConnectionCreated: m, onError: h, onEvent: g, reconnectConnection: _, reconnectSettings: v }) {
|
|
25
|
+
let [y, b] = s(!1), [x, S] = s(!1), [C, w] = s(""), [T, E] = s(null), [D, O] = s(null), k = o(null), A = o(null), j = o(null), M = o(v ?? null);
|
|
26
|
+
a(() => {
|
|
27
|
+
M.current = v ?? null;
|
|
28
|
+
}, [v]), a(() => () => {
|
|
29
|
+
k.current?.(), A.current && !A.current.closed && A.current.close();
|
|
28
30
|
}, []);
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
}, [m]),
|
|
32
|
-
|
|
33
|
-
}, [h]),
|
|
34
|
-
|
|
31
|
+
let N = i((e) => {
|
|
32
|
+
j.current = null, O(null), E(e), m?.(e);
|
|
33
|
+
}, [m]), P = i((e) => {
|
|
34
|
+
w(e), h?.(Error(e));
|
|
35
|
+
}, [h]), F = i((t, n, i, a) => {
|
|
36
|
+
A.current = n, O(null), S(!0), g?.({
|
|
35
37
|
type: "oauth-started",
|
|
36
38
|
connectionId: t,
|
|
37
39
|
providerKey: i.key
|
|
38
|
-
}),
|
|
40
|
+
}), k.current?.(), k.current = r({
|
|
39
41
|
connectionId: t,
|
|
40
42
|
popup: n,
|
|
41
43
|
fetchConnection: () => e.getConnection(t),
|
|
42
|
-
|
|
44
|
+
baseline: a,
|
|
45
|
+
onSuccess: (e) => N({
|
|
43
46
|
...e,
|
|
44
47
|
provider: i
|
|
45
48
|
}),
|
|
@@ -49,94 +52,105 @@ function m({ api: e, callbackUrl: d, translate: f, onConnectionCreated: m, onErr
|
|
|
49
52
|
connectionId: t,
|
|
50
53
|
providerKey: i.key,
|
|
51
54
|
error: e
|
|
52
|
-
}),
|
|
55
|
+
}), P(e);
|
|
53
56
|
},
|
|
54
57
|
onSettled: () => {
|
|
55
|
-
|
|
58
|
+
k.current = null, A.current = null, S(!1);
|
|
56
59
|
}
|
|
57
60
|
});
|
|
58
61
|
}, [
|
|
59
62
|
e,
|
|
60
63
|
g,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
]),
|
|
64
|
-
if (!
|
|
65
|
-
let e = p(
|
|
66
|
-
e && (
|
|
67
|
-
}, [
|
|
68
|
-
|
|
64
|
+
N,
|
|
65
|
+
P
|
|
66
|
+
]), I = i(() => {
|
|
67
|
+
if (!D) return;
|
|
68
|
+
let e = p(D.redirectUrl);
|
|
69
|
+
e && (w(""), F(D.connectionId, e, D.provider, D.baseline));
|
|
70
|
+
}, [D, F]), L = i(() => {
|
|
71
|
+
k.current?.(), k.current = null, A.current && !A.current.closed && A.current.close(), A.current = null, S(!1);
|
|
69
72
|
}, []);
|
|
70
73
|
return {
|
|
71
74
|
submit: i(async (r, i) => {
|
|
72
|
-
if (
|
|
75
|
+
if (y || x) return;
|
|
73
76
|
let a = n(r, f);
|
|
74
77
|
if (a) {
|
|
75
|
-
|
|
78
|
+
w(a);
|
|
76
79
|
return;
|
|
77
80
|
}
|
|
78
81
|
let { provider: o } = r;
|
|
79
|
-
|
|
80
|
-
let s = _ ? null : c(r), m = l(_,
|
|
82
|
+
w(""), O(null), b(!0);
|
|
83
|
+
let s = _ ? null : c(r), m = l(_, j.current, s);
|
|
81
84
|
try {
|
|
82
|
-
let n
|
|
85
|
+
let n;
|
|
86
|
+
if (_) {
|
|
87
|
+
let e = M.current;
|
|
88
|
+
if (!e) throw Error(f("integrations.addConnection.reconnect.settingsUnavailable", "This connection's current settings could not be read. Close the dialog and try again."));
|
|
89
|
+
n = e;
|
|
90
|
+
}
|
|
91
|
+
let a = await t(e, r, {
|
|
83
92
|
redirectUri: d,
|
|
84
93
|
scopes: i,
|
|
85
94
|
existing: m,
|
|
95
|
+
reconnectFrom: n,
|
|
96
|
+
onReconnectSaved: (e) => {
|
|
97
|
+
M.current = e;
|
|
98
|
+
},
|
|
86
99
|
onCreated: (e) => {
|
|
87
|
-
s !== null && (
|
|
100
|
+
s !== null && (j.current = {
|
|
88
101
|
inputKey: s,
|
|
89
102
|
connection: e,
|
|
90
103
|
announced: !1
|
|
91
104
|
});
|
|
92
105
|
}
|
|
93
106
|
});
|
|
94
|
-
if (u(
|
|
107
|
+
if (u(a.connection.id, j.current, _) && (j.current?.connection.id === a.connection.id && (j.current.announced = !0), g?.({
|
|
95
108
|
type: "connection-created",
|
|
96
|
-
connectionId:
|
|
109
|
+
connectionId: a.connection.id,
|
|
97
110
|
providerKey: o.key
|
|
98
|
-
})),
|
|
99
|
-
|
|
100
|
-
...
|
|
111
|
+
})), a.kind === "done") {
|
|
112
|
+
N({
|
|
113
|
+
...a.connection,
|
|
101
114
|
provider: o
|
|
102
115
|
});
|
|
103
116
|
return;
|
|
104
117
|
}
|
|
105
|
-
let
|
|
106
|
-
if (!
|
|
107
|
-
|
|
108
|
-
connectionId:
|
|
109
|
-
redirectUrl:
|
|
110
|
-
provider: o
|
|
111
|
-
|
|
118
|
+
let c = p(a.redirectUrl);
|
|
119
|
+
if (!c) {
|
|
120
|
+
O({
|
|
121
|
+
connectionId: a.connection.id,
|
|
122
|
+
redirectUrl: a.redirectUrl,
|
|
123
|
+
provider: o,
|
|
124
|
+
baseline: a.baseline
|
|
125
|
+
}), P(f("integrations.addConnection.authentication.popupBlocked", "Popup was blocked. Please allow popups for this site and try again.", { provider: o.name }));
|
|
112
126
|
return;
|
|
113
127
|
}
|
|
114
|
-
|
|
128
|
+
F(a.connection.id, c, o, a.baseline);
|
|
115
129
|
} catch (e) {
|
|
116
|
-
|
|
130
|
+
P(e instanceof Error ? e.message : f("integrations.addConnection.errors.authFailed", "Authentication failed"));
|
|
117
131
|
} finally {
|
|
118
|
-
|
|
132
|
+
b(!1);
|
|
119
133
|
}
|
|
120
134
|
}, [
|
|
121
|
-
|
|
122
|
-
|
|
135
|
+
y,
|
|
136
|
+
x,
|
|
123
137
|
f,
|
|
124
138
|
e,
|
|
125
139
|
d,
|
|
126
140
|
g,
|
|
127
|
-
j,
|
|
128
|
-
M,
|
|
129
141
|
N,
|
|
142
|
+
P,
|
|
143
|
+
F,
|
|
130
144
|
_
|
|
131
145
|
]),
|
|
132
|
-
busy:
|
|
133
|
-
oauthWaiting:
|
|
134
|
-
errorMessage:
|
|
135
|
-
setErrorMessage:
|
|
136
|
-
created:
|
|
137
|
-
signInBlocked:
|
|
138
|
-
openBlockedSignIn:
|
|
139
|
-
cancelSignIn:
|
|
146
|
+
busy: y || x,
|
|
147
|
+
oauthWaiting: x,
|
|
148
|
+
errorMessage: C,
|
|
149
|
+
setErrorMessage: w,
|
|
150
|
+
created: T,
|
|
151
|
+
signInBlocked: D !== null,
|
|
152
|
+
openBlockedSignIn: I,
|
|
153
|
+
cancelSignIn: L
|
|
140
154
|
};
|
|
141
155
|
}
|
|
142
156
|
export { c as createInputKey, l as reusableRecord, u as shouldAnnounce, m as useConnectionSubmit };
|
package/dist/connections.js
CHANGED
|
@@ -13,9 +13,9 @@ import { EMPTY_STORAGE as x, compatibleSecrets as S, defaultVault as C, withDefa
|
|
|
13
13
|
import { POPULAR_PROVIDER_KEYS as T, groupByCategory as E, isPopularProvider as D, needsAdminSetup as O, pickableProviders as k, popularFirst as A } from "./connections/picker.js";
|
|
14
14
|
import { ScopePicker as j } from "./connections/ScopePicker.js";
|
|
15
15
|
import { createConnectionsApi as M, mapProvider as N, normalizeAuthType as P } from "./connections/api.js";
|
|
16
|
-
import {
|
|
17
|
-
import { isOAuthCallbackMessage as
|
|
18
|
-
import { getProviderAccent as
|
|
19
|
-
import { isScopeChecked as
|
|
20
|
-
import { authTypeLabel as
|
|
21
|
-
export { t as CONNECTION_DIALOG_FRAME_CLASSES, y as CONNECT_MORE_OPTIONS_KEY, e as ConnectionDialog, v as CredentialStorageSelector, x as EMPTY_STORAGE, b as OneScreenConnectionForm, T as POPULAR_PROVIDER_KEYS, n as ProviderIcon, s as ResourceShareDialog, c as ResourceSharePanel, p as SHARE_PICKER_LIMIT, r as SHARE_TITLE_ID, j as ScopePicker, i as ShareConnectionDialog, f as VisibilityChoice,
|
|
16
|
+
import { applyReconnectUpdate as F, buildCreateInput as I, buildReconnectUpdate as L, collectsOwnClientId as R, flowForAuthType as z, isSecretField as B, reconnectEditsConfig as V, reconnectInitialValues as H, reconnectSchema as U, resolveFlow as W, resolveMethod as G, resolveSchema as K, submitConnection as q, submittedValues as J, validateDraft as Y } from "./connections/connectionFlow.js";
|
|
17
|
+
import { isOAuthCallbackMessage as X, waitForOAuthCompletion as Z } from "./connections/oauthPopup.js";
|
|
18
|
+
import { getProviderAccent as Q, getProviderIconName as $, getProviderImageSource as ee, getProviderTextIcon as te, normalizeProviderCategory as ne } from "./connections/providerIdentity.js";
|
|
19
|
+
import { isScopeChecked as re, parseScopeOptions as ie, requestedScopes as ae, toggleScope as oe } from "./connections/scopes.js";
|
|
20
|
+
import { authTypeLabel as se, categoryLabel as ce } from "./connections/labels.js";
|
|
21
|
+
export { t as CONNECTION_DIALOG_FRAME_CLASSES, y as CONNECT_MORE_OPTIONS_KEY, e as ConnectionDialog, v as CredentialStorageSelector, x as EMPTY_STORAGE, b as OneScreenConnectionForm, T as POPULAR_PROVIDER_KEYS, n as ProviderIcon, s as ResourceShareDialog, c as ResourceSharePanel, p as SHARE_PICKER_LIMIT, r as SHARE_TITLE_ID, j as ScopePicker, i as ShareConnectionDialog, f as VisibilityChoice, F as applyReconnectUpdate, se as authTypeLabel, I as buildCreateInput, L as buildReconnectUpdate, m as canManageSharing, ce as categoryLabel, R as collectsOwnClientId, S as compatibleSecrets, a as connectionShareCopy, o as connectionVisibilityCopy, h as createConnectionSharingApi, M as createConnectionsApi, g as createSharePrincipalLister, C as defaultVault, z as flowForAuthType, Q as getProviderAccent, $ as getProviderIconName, ee as getProviderImageSource, te as getProviderTextIcon, E as groupByCategory, X as isOAuthCallbackMessage, D as isPopularProvider, re as isScopeChecked, B as isSecretField, _ as mapConnectionSharing, N as mapProvider, O as needsAdminSetup, P as normalizeAuthType, ne as normalizeProviderCategory, ie as parseScopeOptions, k as pickableProviders, A as popularFirst, l as principalKey, V as reconnectEditsConfig, H as reconnectInitialValues, U as reconnectSchema, ae as requestedScopes, W as resolveFlow, G as resolveMethod, K as resolveSchema, u as resourceShareInput, q as submitConnection, J as submittedValues, oe as toggleScope, d as useResourceSharingDraft, Y as validateDraft, Z as waitForOAuthCompletion, w as withDefaultVault };
|