@declarion/react 0.177.0 → 0.180.0
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-lib/api/access-expiry.js +28 -6
- package/dist-lib/api/agents.js +19 -8
- package/dist-lib/api/auth.js +63 -62
- package/dist-lib/components/agents/AgentChatPanel.impl.js +275 -177
- package/dist-lib/components/agents/transcript-runs.js +19 -7
- package/dist-lib/components/detail-layout/EvidenceBlock.js +1 -1
- package/dist-lib/components/pages/auth/SignIn.js +4 -2
- package/dist-lib/components/pages/profile/Profile.impl.js +149 -135
- package/dist-lib/index.d.ts +19 -1
- package/dist-lib/stores/auth.js +45 -45
- package/package.json +1 -1
|
@@ -14,7 +14,29 @@ function n() {
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
var r = "declarion.auth.signed_out";
|
|
18
|
+
function i() {
|
|
19
|
+
try {
|
|
20
|
+
window.localStorage.setItem(r, "1");
|
|
21
|
+
} catch {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function a() {
|
|
26
|
+
try {
|
|
27
|
+
window.localStorage.removeItem(r);
|
|
28
|
+
} catch {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function o() {
|
|
33
|
+
try {
|
|
34
|
+
return window.localStorage.getItem(r) === "1";
|
|
35
|
+
} catch {
|
|
36
|
+
return !1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function s() {
|
|
18
40
|
try {
|
|
19
41
|
let t = Date.parse(window.localStorage.getItem(e) ?? "");
|
|
20
42
|
return Number.isNaN(t) ? null : t;
|
|
@@ -22,11 +44,11 @@ function r() {
|
|
|
22
44
|
return null;
|
|
23
45
|
}
|
|
24
46
|
}
|
|
25
|
-
var
|
|
26
|
-
function
|
|
47
|
+
var c = "/login/sso-callback";
|
|
48
|
+
function l(e, t, n = !1) {
|
|
27
49
|
return n ? "first-wave" : e === null ? "probe-first" : e > t ? "first-wave" : "refresh-first";
|
|
28
50
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
51
|
+
function u() {
|
|
52
|
+
return l(s(), Date.now(), window.location.pathname === c);
|
|
31
53
|
}
|
|
32
|
-
export {
|
|
54
|
+
export { c as SSO_RETURN_PATH, n as clearAccessExpiry, a as clearSignOut, t as recordAccessExpiry, i as recordSignOut, o as signedOutExplicitly, l as startOrder, u as startOrderNow };
|
package/dist-lib/api/agents.js
CHANGED
|
@@ -82,14 +82,25 @@ async function p(e) {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
async function m(e) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
let n = [];
|
|
86
|
+
for (let r = 1;; r += 1) {
|
|
87
|
+
let i = await t("agent_message", {
|
|
88
|
+
filters: [{
|
|
89
|
+
field: "conversation_id",
|
|
90
|
+
op: "eq",
|
|
91
|
+
value: e
|
|
92
|
+
}],
|
|
93
|
+
sort: "seq:asc",
|
|
94
|
+
page: r,
|
|
95
|
+
per_page: 1e3
|
|
96
|
+
}), a = i.data ?? [];
|
|
97
|
+
if (n.push(...a.map((e) => ({
|
|
98
|
+
...e,
|
|
99
|
+
bot: e.bot_id ? i.$refs?.agent_bot?.[e.bot_id]?.display_name : void 0,
|
|
100
|
+
sender_user: e.sender_user_id ? i.$refs?.user?.[e.sender_user_id]?.display_name : void 0
|
|
101
|
+
}))), i.meta?.has_more !== !0) return n;
|
|
102
|
+
if (a.length === 0) throw Error("agent_message pagination did not advance");
|
|
103
|
+
}
|
|
93
104
|
}
|
|
94
105
|
async function h(e, n) {
|
|
95
106
|
let r = [];
|
package/dist-lib/api/auth.js
CHANGED
|
@@ -1,85 +1,86 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { recordSignOut as e, signedOutExplicitly as t } from "./access-expiry.js";
|
|
2
|
+
import { beginSessionInPage as n, callHandler as r, scheduleProactiveRefresh as i } from "./client.js";
|
|
2
3
|
// src/api/auth.ts
|
|
3
|
-
var
|
|
4
|
-
async function
|
|
5
|
-
await
|
|
6
|
-
}
|
|
7
|
-
async function
|
|
8
|
-
return
|
|
9
|
-
}
|
|
10
|
-
async function
|
|
11
|
-
await
|
|
12
|
-
let
|
|
13
|
-
email:
|
|
14
|
-
password:
|
|
15
|
-
remember:
|
|
4
|
+
var a;
|
|
5
|
+
async function o() {
|
|
6
|
+
await a?.catch(() => void 0);
|
|
7
|
+
}
|
|
8
|
+
async function s() {
|
|
9
|
+
return r("auth.check_setup", {}, { credentials: "omit" });
|
|
10
|
+
}
|
|
11
|
+
async function c(e, t, i = !0) {
|
|
12
|
+
await o();
|
|
13
|
+
let a = await r("auth.login", {
|
|
14
|
+
email: e,
|
|
15
|
+
password: t,
|
|
16
|
+
remember: i
|
|
16
17
|
});
|
|
17
|
-
return
|
|
18
|
-
}
|
|
19
|
-
async function
|
|
20
|
-
await
|
|
21
|
-
let
|
|
22
|
-
email:
|
|
23
|
-
password:
|
|
24
|
-
display_name:
|
|
18
|
+
return n(a.expires_at), a;
|
|
19
|
+
}
|
|
20
|
+
async function l(e, t, i) {
|
|
21
|
+
await o();
|
|
22
|
+
let a = await r("auth.signup", {
|
|
23
|
+
email: e,
|
|
24
|
+
password: t,
|
|
25
|
+
display_name: i
|
|
25
26
|
});
|
|
26
|
-
return
|
|
27
|
+
return a.verification_required || n(a.expires_at), a;
|
|
27
28
|
}
|
|
28
|
-
async function
|
|
29
|
-
await
|
|
30
|
-
let
|
|
31
|
-
email:
|
|
32
|
-
code:
|
|
29
|
+
async function u(e, t) {
|
|
30
|
+
await o();
|
|
31
|
+
let i = await r("auth.confirm_signup", {
|
|
32
|
+
email: e,
|
|
33
|
+
code: t
|
|
33
34
|
});
|
|
34
|
-
return
|
|
35
|
+
return n(i.expires_at), i;
|
|
35
36
|
}
|
|
36
|
-
async function
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
async function u() {
|
|
40
|
-
return t("auth.me");
|
|
41
|
-
}
|
|
42
|
-
async function d() {
|
|
43
|
-
return t("auth.me", {}, { isSessionProbe: !0 });
|
|
37
|
+
async function d(e) {
|
|
38
|
+
return r("auth.resend_signup_code", { email: e });
|
|
44
39
|
}
|
|
45
40
|
async function f() {
|
|
46
|
-
return (
|
|
41
|
+
return r("auth.me");
|
|
47
42
|
}
|
|
48
|
-
async function p(
|
|
49
|
-
|
|
50
|
-
return n(r.expires_at), r;
|
|
43
|
+
async function p() {
|
|
44
|
+
return r("auth.me", {}, { isSessionProbe: !0 });
|
|
51
45
|
}
|
|
52
|
-
function m() {
|
|
53
|
-
return r
|
|
54
|
-
r = void 0;
|
|
55
|
-
}), r;
|
|
46
|
+
async function m() {
|
|
47
|
+
return (await r("auth.list_tenants")).tenants;
|
|
56
48
|
}
|
|
57
49
|
async function h(e) {
|
|
58
|
-
|
|
50
|
+
let t = await r("auth.switch_tenant", { tenant_id: e });
|
|
51
|
+
return i(t.expires_at), t;
|
|
52
|
+
}
|
|
53
|
+
function g() {
|
|
54
|
+
return e(), a ??= r("auth.logout", {}, { keepalive: !0 }).then(() => void 0).finally(() => {
|
|
55
|
+
a = void 0;
|
|
56
|
+
}), a;
|
|
57
|
+
}
|
|
58
|
+
async function _(e) {
|
|
59
|
+
return (await r("auth.list_identity_providers", e ? { tenant_code: e } : {}, { credentials: "omit" })).providers;
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
let
|
|
62
|
-
|
|
63
|
-
let
|
|
64
|
-
return `/api/auth/sso/authorize/${encodeURIComponent(e)}${
|
|
61
|
+
function v(e, n, r) {
|
|
62
|
+
let i = new URLSearchParams();
|
|
63
|
+
n && i.set("tenant", n), r && i.set("redirect", r), t() && i.set("after_sign_out", "1");
|
|
64
|
+
let a = i.toString();
|
|
65
|
+
return `/api/auth/sso/authorize/${encodeURIComponent(e)}${a ? `?${a}` : ""}`;
|
|
65
66
|
}
|
|
66
|
-
async function
|
|
67
|
+
async function y(e, t, n) {
|
|
67
68
|
let i = {
|
|
68
69
|
target_user_id: e,
|
|
69
|
-
reason:
|
|
70
|
+
reason: t
|
|
70
71
|
};
|
|
71
|
-
return
|
|
72
|
+
return n != null && (i.duration_minutes = n), r("impersonation.start", i);
|
|
72
73
|
}
|
|
73
|
-
async function
|
|
74
|
-
return
|
|
74
|
+
async function b() {
|
|
75
|
+
return r("impersonation.stop");
|
|
75
76
|
}
|
|
76
|
-
async function
|
|
77
|
-
await
|
|
77
|
+
async function x(e) {
|
|
78
|
+
await r("impersonation.revoke", { session_id: e });
|
|
78
79
|
}
|
|
79
|
-
async function
|
|
80
|
-
await
|
|
80
|
+
async function S(e, t) {
|
|
81
|
+
await r("auth.change_password", {
|
|
81
82
|
current_password: e,
|
|
82
|
-
new_password:
|
|
83
|
+
new_password: t
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
|
-
export {
|
|
86
|
+
export { S as changePassword, s as checkSetup, u as confirmSignup, f as getMe, x as impersonationRevoke, y as impersonationStart, b as impersonationStop, _ as listIdentityProviders, m as listTenants, c as login, g as logout, p as probeSession, d as resendSignupCode, l as signup, v as ssoAuthorizeUrl, h as switchTenant, o as waitForLogout };
|