@archbase/security 3.0.4 → 3.0.5
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/index.js +705 -692
- package/dist/src/ArchbaseSecurityContext.d.ts +7 -0
- package/dist/src/index.d.ts +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
2
|
import * as I from "inversify";
|
|
3
|
-
import { decorate as
|
|
4
|
-
import { compressString as
|
|
3
|
+
import { decorate as At, injectable as Et } from "inversify";
|
|
4
|
+
import { compressString as xt, decompressString as St, IOCContainer as kt, ARCHBASE_IOC_API_TYPE as G, processErrorMessage as ee, IsNotEmpty as J, IsOptional as re, IsBoolean as q, IsEmail as It, getKeyByEnumValue as Ve, useArchbasePasswordRemember as Pt, getI18nextInstance as S, useArchbaseTheme as Tt, isEmailValidate as Ct, useArchbaseAppContext as Ut } from "@archbase/core";
|
|
5
5
|
import F from "crypto-js";
|
|
6
|
-
import { jwtDecode as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import
|
|
9
|
-
import { BehaviorSubject as
|
|
10
|
-
import { ArchbaseRemoteApiService as ce, useArchbaseStore as
|
|
11
|
-
import { v4 as
|
|
12
|
-
import { Card as
|
|
13
|
-
import { useFocusTrap as
|
|
14
|
-
import { IconCopy as
|
|
15
|
-
import { ArchbaseDialog as
|
|
16
|
-
import { useContainer as
|
|
17
|
-
class
|
|
6
|
+
import { jwtDecode as Dt } from "jwt-decode";
|
|
7
|
+
import { jsx as l, jsxs as R, Fragment as te } from "react/jsx-runtime";
|
|
8
|
+
import Ge, { useState as f, useEffect as z, createContext as Re, useMemo as _t, useRef as Rt, useCallback as pe, useContext as Ne } from "react";
|
|
9
|
+
import { BehaviorSubject as ze } from "rxjs";
|
|
10
|
+
import { ArchbaseRemoteApiService as ce, useArchbaseStore as Je } from "@archbase/data";
|
|
11
|
+
import { v4 as K } from "uuid";
|
|
12
|
+
import { Card as Ke, Text as se, Divider as ye, Group as we, Select as Nt, Tooltip as Bt, Button as ie, TextInput as Ce, Loader as qe, PasswordInput as Ue, Checkbox as Mt, Anchor as Ot, useMantineColorScheme as Lt, Box as $t, Stack as jt, Skeleton as fe } from "@mantine/core";
|
|
13
|
+
import { useFocusTrap as Ye } from "@mantine/hooks";
|
|
14
|
+
import { IconCopy as Ft } from "@tabler/icons-react";
|
|
15
|
+
import { ArchbaseDialog as We } from "@archbase/components";
|
|
16
|
+
import { useContainer as ve } from "inversify-react";
|
|
17
|
+
class Xe {
|
|
18
18
|
id;
|
|
19
19
|
displayName;
|
|
20
20
|
email;
|
|
@@ -24,10 +24,10 @@ class qe {
|
|
|
24
24
|
this.id = e.id, this.displayName = e.displayName, this.email = e.email, this.photo = e.photo, this.isAdmin = e.isAdmin;
|
|
25
25
|
}
|
|
26
26
|
static newInstance() {
|
|
27
|
-
return new
|
|
27
|
+
return new Xe({});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class Qe {
|
|
31
31
|
username;
|
|
32
32
|
password;
|
|
33
33
|
remember;
|
|
@@ -35,14 +35,14 @@ class Ye {
|
|
|
35
35
|
this.username = e.username, this.password = e.password, this.remember = e.remember;
|
|
36
36
|
}
|
|
37
37
|
static newInstance() {
|
|
38
|
-
return new
|
|
38
|
+
return new Qe({});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const Q = "YngzI1guK3dGaElFcFY9MywqK3xgPzg/Ojg7eD8xRmg=",
|
|
42
|
-
class
|
|
41
|
+
const Q = "YngzI1guK3dGaElFcFY9MywqK3xgPzg/Ojg7eD8xRmg=", ke = "c1ab58e7-c113-4225-a190-a9e59d1207fc", Ie = "6faf6932-a0b5-457b-83b1-8d89ddbd91fd", Pe = "602b05c5-ec46-451e-aba6-187e463bc245", Te = "8b4a7c2d-9e5f-4163-b8a7-3f2c9d8e5a1b";
|
|
42
|
+
class Vt {
|
|
43
43
|
getUsernameAndPassword() {
|
|
44
44
|
try {
|
|
45
|
-
const e = localStorage.getItem(
|
|
45
|
+
const e = localStorage.getItem(Ie);
|
|
46
46
|
if (e) {
|
|
47
47
|
const t = F.AES.decrypt(e, Q).toString(F.enc.Utf8), o = atob(t).split(":");
|
|
48
48
|
return { username: o[0], password: o[1], remember: !0 };
|
|
@@ -54,11 +54,11 @@ class $t {
|
|
|
54
54
|
}
|
|
55
55
|
saveUsernameAndPassword(e, t) {
|
|
56
56
|
const s = btoa(`${e}:${t}`), o = F.AES.encrypt(s, Q).toString();
|
|
57
|
-
localStorage.setItem(
|
|
57
|
+
localStorage.setItem(Ie, o);
|
|
58
58
|
}
|
|
59
59
|
getUsername() {
|
|
60
60
|
try {
|
|
61
|
-
const e = localStorage.getItem(
|
|
61
|
+
const e = localStorage.getItem(Pe);
|
|
62
62
|
if (e) {
|
|
63
63
|
const t = F.AES.decrypt(e, Q).toString(F.enc.Utf8);
|
|
64
64
|
return atob(t);
|
|
@@ -70,14 +70,14 @@ class $t {
|
|
|
70
70
|
}
|
|
71
71
|
saveUsername(e) {
|
|
72
72
|
const t = btoa(e), s = F.AES.encrypt(t, Q).toString();
|
|
73
|
-
localStorage.setItem(
|
|
73
|
+
localStorage.setItem(Pe, s);
|
|
74
74
|
}
|
|
75
75
|
isTokenExpired(e, t = 300) {
|
|
76
76
|
let s = e;
|
|
77
77
|
if (!s && !this.getToken())
|
|
78
78
|
return !0;
|
|
79
79
|
try {
|
|
80
|
-
const o =
|
|
80
|
+
const o = Dt(s.access_token);
|
|
81
81
|
if (!o)
|
|
82
82
|
return !0;
|
|
83
83
|
const a = Math.floor(Date.now() / 1e3), d = o.exp;
|
|
@@ -88,23 +88,23 @@ class $t {
|
|
|
88
88
|
}
|
|
89
89
|
saveToken(e) {
|
|
90
90
|
if (e) {
|
|
91
|
-
const t = JSON.stringify(e), s = F.AES.encrypt(t, Q).toString(), o =
|
|
92
|
-
localStorage.setItem(
|
|
91
|
+
const t = JSON.stringify(e), s = F.AES.encrypt(t, Q).toString(), o = xt(s);
|
|
92
|
+
localStorage.setItem(ke, o);
|
|
93
93
|
} else
|
|
94
94
|
this.clearToken();
|
|
95
95
|
}
|
|
96
96
|
clearUsernameAndPassword() {
|
|
97
|
-
localStorage.removeItem(
|
|
97
|
+
localStorage.removeItem(Ie), localStorage.removeItem(Pe);
|
|
98
98
|
}
|
|
99
99
|
clearToken() {
|
|
100
|
-
localStorage.removeItem(
|
|
100
|
+
localStorage.removeItem(ke);
|
|
101
101
|
}
|
|
102
102
|
getToken() {
|
|
103
103
|
try {
|
|
104
|
-
const e = localStorage.getItem(
|
|
104
|
+
const e = localStorage.getItem(ke);
|
|
105
105
|
if (!e)
|
|
106
106
|
return null;
|
|
107
|
-
const t =
|
|
107
|
+
const t = St(e), s = F.AES.decrypt(t, Q).toString(F.enc.Utf8);
|
|
108
108
|
return JSON.parse(s);
|
|
109
109
|
} catch {
|
|
110
110
|
return null;
|
|
@@ -113,36 +113,36 @@ class $t {
|
|
|
113
113
|
saveContext(e) {
|
|
114
114
|
try {
|
|
115
115
|
const t = F.AES.encrypt(e, Q).toString();
|
|
116
|
-
localStorage.setItem(
|
|
116
|
+
localStorage.setItem(Te, t);
|
|
117
117
|
} catch (t) {
|
|
118
118
|
console.warn("Erro ao salvar contexto:", t);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
getContext() {
|
|
122
122
|
try {
|
|
123
|
-
const e = localStorage.getItem(
|
|
123
|
+
const e = localStorage.getItem(Te);
|
|
124
124
|
return e ? F.AES.decrypt(e, Q).toString(F.enc.Utf8) : null;
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
clearContext() {
|
|
130
|
-
localStorage.removeItem(
|
|
130
|
+
localStorage.removeItem(Te);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
function
|
|
133
|
+
At(Et(), Vt);
|
|
134
|
+
function Ze(r) {
|
|
135
135
|
const t = new Uint8Array(1);
|
|
136
|
-
return window.crypto.getRandomValues(t), t[0] >= Math.floor(256 / r) * r ?
|
|
136
|
+
return window.crypto.getRandomValues(t), t[0] >= Math.floor(256 / r) * r ? Ze(r) : t[0] % r;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function zt(r) {
|
|
139
139
|
let e = "";
|
|
140
140
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
141
141
|
for (let s = 0; s < r; s++)
|
|
142
|
-
e += t.charAt(
|
|
142
|
+
e += t.charAt(Ze(t.length - 1));
|
|
143
143
|
return e;
|
|
144
144
|
}
|
|
145
|
-
async function
|
|
145
|
+
async function Wt(r) {
|
|
146
146
|
if (!window.crypto.subtle?.digest)
|
|
147
147
|
throw new Error(
|
|
148
148
|
"The context/environment is not secure, and does not support the 'crypto.subtle' module. See: https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle for details"
|
|
@@ -150,36 +150,36 @@ async function Ft(r) {
|
|
|
150
150
|
const t = new TextEncoder().encode(r), s = await window.crypto.subtle.digest("SHA-256", t), o = String.fromCharCode(...new Uint8Array(s));
|
|
151
151
|
return btoa(o).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
152
152
|
}
|
|
153
|
-
class
|
|
153
|
+
class et extends Error {
|
|
154
154
|
status;
|
|
155
155
|
statusText;
|
|
156
156
|
constructor(e, t, s) {
|
|
157
157
|
super(s), this.name = "FetchError", this.status = e, this.statusText = t;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Ht(r) {
|
|
161
161
|
let e = "";
|
|
162
162
|
return Object.entries(r).forEach(([t, s]) => {
|
|
163
163
|
e += (e ? "&" : "") + t + "=" + encodeURIComponent(s);
|
|
164
164
|
}), e;
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
166
|
+
async function Gt(r, e) {
|
|
167
167
|
return fetch(r, {
|
|
168
168
|
method: "POST",
|
|
169
|
-
body:
|
|
169
|
+
body: Ht(e),
|
|
170
170
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
171
171
|
}).then(async (t) => {
|
|
172
172
|
if (!t.ok) {
|
|
173
173
|
const s = await t.text();
|
|
174
|
-
throw new
|
|
174
|
+
throw new et(t.status, t.statusText, s);
|
|
175
175
|
}
|
|
176
176
|
return t;
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
const
|
|
180
|
-
async function
|
|
181
|
-
const t =
|
|
182
|
-
return sessionStorage.setItem(
|
|
179
|
+
const tt = "PKCE_code_verifier", De = "ROCP_auth_state";
|
|
180
|
+
async function Jt(r, e) {
|
|
181
|
+
const t = zt(96);
|
|
182
|
+
return sessionStorage.setItem(tt, t), Wt(t).then((s) => {
|
|
183
183
|
const o = new URLSearchParams({
|
|
184
184
|
response_type: "code",
|
|
185
185
|
client_id: r.clientId,
|
|
@@ -188,23 +188,23 @@ async function Wt(r, e) {
|
|
|
188
188
|
code_challenge_method: "S256",
|
|
189
189
|
...r.extraAuthParameters
|
|
190
190
|
});
|
|
191
|
-
r.scope !== void 0 && o.append("scope", r.scope), sessionStorage.removeItem(
|
|
191
|
+
r.scope !== void 0 && o.append("scope", r.scope), sessionStorage.removeItem(De);
|
|
192
192
|
const a = e ?? r.state;
|
|
193
|
-
a && (sessionStorage.setItem(
|
|
193
|
+
a && (sessionStorage.setItem(De, a), o.append("state", a)), r?.preLogin && r.preLogin(), window.location.replace(`${r.authorizationEndpoint}?${o.toString()}`);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Kt(r) {
|
|
197
197
|
return r.access_token !== void 0;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
201
|
-
if (
|
|
199
|
+
function rt(r, e) {
|
|
200
|
+
return Gt(r, e).then((t) => t.json().then((s) => {
|
|
201
|
+
if (Kt(s))
|
|
202
202
|
return s;
|
|
203
203
|
throw Error(s);
|
|
204
204
|
}));
|
|
205
205
|
}
|
|
206
|
-
const
|
|
207
|
-
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(
|
|
206
|
+
const qt = (r) => {
|
|
207
|
+
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(tt);
|
|
208
208
|
if (!t)
|
|
209
209
|
throw Error(`Parâmetro 'código' não encontrado na URL.
|
|
210
210
|
A autenticação ocorreu?`);
|
|
@@ -221,8 +221,8 @@ A autenticação ocorreu?`);
|
|
|
221
221
|
...r.extraTokenParameters,
|
|
222
222
|
...r.extraAuthParams
|
|
223
223
|
};
|
|
224
|
-
return
|
|
225
|
-
},
|
|
224
|
+
return rt(r.tokenEndpoint, o);
|
|
225
|
+
}, Yt = (r) => {
|
|
226
226
|
const { config: e, refreshToken: t } = r, s = {
|
|
227
227
|
grant_type: "refresh_token",
|
|
228
228
|
refresh_token: t,
|
|
@@ -231,36 +231,36 @@ A autenticação ocorreu?`);
|
|
|
231
231
|
redirect_uri: e.redirectUri,
|
|
232
232
|
...e.extraTokenParameters
|
|
233
233
|
};
|
|
234
|
-
return
|
|
234
|
+
return rt(e.tokenEndpoint, s);
|
|
235
235
|
};
|
|
236
|
-
function
|
|
236
|
+
function Xt(r, e, t, s, o, a) {
|
|
237
237
|
const d = new URLSearchParams({
|
|
238
238
|
token: t || e,
|
|
239
239
|
token_type_hint: t ? "refresh_token" : "access_token",
|
|
240
240
|
client_id: r.clientId,
|
|
241
241
|
post_logout_redirect_uri: r.logoutRedirect ?? r.redirectUri,
|
|
242
|
-
ui_locales: window.navigator.languages.reduce((i,
|
|
242
|
+
ui_locales: window.navigator.languages.reduce((i, u) => i + " " + u),
|
|
243
243
|
...r.extraLogoutParameters
|
|
244
244
|
});
|
|
245
245
|
s && d.append("id_token_hint", s), o && d.append("state", o), a && d.append("logout_hint", a), window.location.replace(`${r.logoutEndpoint}?${d.toString()}`);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const e = r.get("state"), t = sessionStorage.getItem(
|
|
247
|
+
function Qt(r) {
|
|
248
|
+
const e = r.get("state"), t = sessionStorage.getItem(De);
|
|
249
249
|
if (e !== t)
|
|
250
250
|
throw new Error(
|
|
251
251
|
'"state" valor recebido do servidor de autenticação não corresponde à solicitação do cliente. Possível falsificação de solicitação entre sites'
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
function Z(r, e, t) {
|
|
255
|
-
const s = t === "session" ? sessionStorage : localStorage, [o, a] =
|
|
255
|
+
const s = t === "session" ? sessionStorage : localStorage, [o, a] = f(() => {
|
|
256
256
|
const i = s.getItem(r);
|
|
257
257
|
try {
|
|
258
258
|
return i ? JSON.parse(i) : e;
|
|
259
|
-
} catch (
|
|
259
|
+
} catch (u) {
|
|
260
260
|
return console.warn(
|
|
261
261
|
`Falha ao analisar o valor armazenado para '${r}'.
|
|
262
262
|
Continuando com o valor padrão.
|
|
263
|
-
Error: ${
|
|
263
|
+
Error: ${u.message}`
|
|
264
264
|
), e;
|
|
265
265
|
}
|
|
266
266
|
}), d = (i) => {
|
|
@@ -269,27 +269,27 @@ Error: ${l.message}`
|
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
try {
|
|
272
|
-
const
|
|
273
|
-
a(
|
|
272
|
+
const u = i instanceof Function ? i(o) : i;
|
|
273
|
+
a(u), s.setItem(r, JSON.stringify(u));
|
|
274
274
|
} catch {
|
|
275
275
|
console.log(`Falha ao armazenar valor '${i}' para chave '${r}'`);
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
278
|
return z(() => {
|
|
279
|
-
const i = (
|
|
280
|
-
|
|
279
|
+
const i = (u) => {
|
|
280
|
+
u.storageArea === s && u.key === r && a(JSON.parse(u.newValue ?? ""));
|
|
281
281
|
};
|
|
282
282
|
return window.addEventListener("storage", i, !1), () => window.removeEventListener("storage", i, !1);
|
|
283
283
|
}), [o, d];
|
|
284
284
|
}
|
|
285
|
-
const
|
|
285
|
+
const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
286
286
|
__proto__: null,
|
|
287
287
|
default: Z
|
|
288
288
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
289
|
-
function
|
|
289
|
+
function me(r) {
|
|
290
290
|
return ["", void 0, null].includes(r);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function Zt(r) {
|
|
293
293
|
const {
|
|
294
294
|
autoLogin: e = !0,
|
|
295
295
|
clearURL: t = !0,
|
|
@@ -298,8 +298,8 @@ function Yt(r) {
|
|
|
298
298
|
preLogin: a = () => null,
|
|
299
299
|
postLogin: d = () => null,
|
|
300
300
|
onRefreshTokenExpire: i = void 0,
|
|
301
|
-
storage:
|
|
302
|
-
} = r,
|
|
301
|
+
storage: u = "local"
|
|
302
|
+
} = r, y = {
|
|
303
303
|
...r,
|
|
304
304
|
autoLogin: e,
|
|
305
305
|
clearURL: t,
|
|
@@ -308,24 +308,24 @@ function Yt(r) {
|
|
|
308
308
|
preLogin: a,
|
|
309
309
|
postLogin: d,
|
|
310
310
|
onRefreshTokenExpire: i,
|
|
311
|
-
storage:
|
|
311
|
+
storage: u
|
|
312
312
|
};
|
|
313
|
-
return
|
|
313
|
+
return er(y), y;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
if (
|
|
315
|
+
function er(r) {
|
|
316
|
+
if (me(r?.clientId))
|
|
317
317
|
throw Error(
|
|
318
318
|
"'clientId' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
319
319
|
);
|
|
320
|
-
if (
|
|
320
|
+
if (me(r?.authorizationEndpoint))
|
|
321
321
|
throw Error(
|
|
322
322
|
"'authorizationEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
323
323
|
);
|
|
324
|
-
if (
|
|
324
|
+
if (me(r?.tokenEndpoint))
|
|
325
325
|
throw Error(
|
|
326
326
|
"'tokenEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
327
327
|
);
|
|
328
|
-
if (
|
|
328
|
+
if (me(r?.redirectUri))
|
|
329
329
|
throw Error(
|
|
330
330
|
"'redirectUri' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
331
331
|
);
|
|
@@ -337,23 +337,23 @@ function Xt(r) {
|
|
|
337
337
|
"Usar 'extraAuthParams' e 'extraTokenParameters' não é recomendado. Eles fazem a mesma coisa e você deve usar apenas 'extraTokenParameters'"
|
|
338
338
|
);
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
function
|
|
340
|
+
const ne = 600, oe = (r) => Math.round(Date.now() / 1e3 + r);
|
|
341
|
+
function He(r) {
|
|
342
342
|
return Math.round(Date.now()) / 1e3 + 30 >= r;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
344
|
+
const tr = [
|
|
345
345
|
"refresh_expires_in",
|
|
346
346
|
// KeyCloak
|
|
347
347
|
"refresh_token_expires_in"
|
|
348
348
|
// Azure AD
|
|
349
349
|
];
|
|
350
|
-
function
|
|
351
|
-
for (const t of
|
|
350
|
+
function rr(r, e) {
|
|
351
|
+
for (const t of tr)
|
|
352
352
|
if (t in e)
|
|
353
353
|
return e[t];
|
|
354
|
-
return e.refresh_token ? r +
|
|
354
|
+
return e.refresh_token ? r + ne : r;
|
|
355
355
|
}
|
|
356
|
-
const
|
|
356
|
+
const ge = (r) => {
|
|
357
357
|
try {
|
|
358
358
|
const t = r.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), s = decodeURIComponent(
|
|
359
359
|
atob(t).split("").map(function(o) {
|
|
@@ -368,88 +368,88 @@ const me = (r) => {
|
|
|
368
368
|
Você pode desativar a decodificação JWT definindo o valor 'decodeToken' como 'falso' na configuração.`
|
|
369
369
|
);
|
|
370
370
|
}
|
|
371
|
-
},
|
|
371
|
+
}, sr = Re({
|
|
372
372
|
token: "",
|
|
373
373
|
login: () => null,
|
|
374
374
|
logOut: () => null,
|
|
375
375
|
error: null,
|
|
376
376
|
loginInProgress: !1
|
|
377
|
-
}),
|
|
378
|
-
const t =
|
|
377
|
+
}), Ur = ({ authConfig: r, children: e }) => {
|
|
378
|
+
const t = _t(() => Zt(r), [r]), [s, o] = Z(
|
|
379
379
|
"ROCP_refreshToken",
|
|
380
380
|
void 0,
|
|
381
381
|
t.storage
|
|
382
382
|
), [a, d] = Z(
|
|
383
383
|
"ROCP_refreshTokenExpire",
|
|
384
|
-
|
|
384
|
+
oe(2 * ne),
|
|
385
385
|
t.storage
|
|
386
|
-
), [i,
|
|
386
|
+
), [i, u] = Z("ROCP_token", "", t.storage), [y, k] = Z(
|
|
387
387
|
"ROCP_tokenExpire",
|
|
388
|
-
|
|
388
|
+
oe(ne),
|
|
389
389
|
t.storage
|
|
390
|
-
), [
|
|
390
|
+
), [h, C] = Z(
|
|
391
391
|
"ROCP_idToken",
|
|
392
392
|
void 0,
|
|
393
393
|
t.storage
|
|
394
|
-
), [
|
|
394
|
+
), [A, g] = Z(
|
|
395
395
|
"ROCP_loginInProgress",
|
|
396
396
|
!1,
|
|
397
397
|
t.storage
|
|
398
|
-
), [
|
|
398
|
+
), [E, U] = Z(
|
|
399
399
|
"ROCP_refreshInProgress",
|
|
400
400
|
!1,
|
|
401
401
|
t.storage
|
|
402
|
-
), [
|
|
403
|
-
let
|
|
404
|
-
function
|
|
405
|
-
o(void 0),
|
|
406
|
-
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
let n =
|
|
413
|
-
|
|
414
|
-
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${
|
|
415
|
-
), n = void 0),
|
|
416
|
-
console.error(
|
|
402
|
+
), [D, O] = f(), [_, N] = f(), [x, b] = f(null);
|
|
403
|
+
let P;
|
|
404
|
+
function W() {
|
|
405
|
+
o(void 0), u(""), k(oe(ne)), d(oe(ne)), C(void 0), O(void 0), N(void 0), g(!1);
|
|
406
|
+
}
|
|
407
|
+
function L(p, n) {
|
|
408
|
+
W(), b(null), t?.logoutEndpoint && Xt(t, i, s, h, p, n);
|
|
409
|
+
}
|
|
410
|
+
function B(p) {
|
|
411
|
+
W(), g(!0);
|
|
412
|
+
let n = p;
|
|
413
|
+
p && typeof p != "string" && (console.warn(
|
|
414
|
+
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${p}'. Ignorando o valor...`
|
|
415
|
+
), n = void 0), Jt(t, n).catch((w) => {
|
|
416
|
+
console.error(w), b(w.message), g(!1);
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
|
|
421
|
-
const n = t.tokenExpiresIn ??
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
d(
|
|
419
|
+
function H(p) {
|
|
420
|
+
u(p.access_token), o(p.refresh_token);
|
|
421
|
+
const n = t.tokenExpiresIn ?? p.expires_in ?? ne;
|
|
422
|
+
k(oe(n));
|
|
423
|
+
const w = t.refreshTokenExpiresIn ?? rr(n, p);
|
|
424
|
+
d(oe(w)), C(p.id_token);
|
|
425
425
|
try {
|
|
426
|
-
|
|
426
|
+
p.id_token && N(ge(p.id_token));
|
|
427
427
|
} catch (c) {
|
|
428
428
|
console.warn(`Falha ao decodificar idToken: ${c.message}`);
|
|
429
429
|
}
|
|
430
430
|
try {
|
|
431
|
-
t.decodeToken &&
|
|
431
|
+
t.decodeToken && O(ge(p.access_token));
|
|
432
432
|
} catch (c) {
|
|
433
433
|
console.warn(`Falha ao decodificar o token de acesso: ${c.message}`);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
function Y(
|
|
437
|
-
return
|
|
436
|
+
function Y(p = !1) {
|
|
437
|
+
return p || !t.onRefreshTokenExpire ? B() : t.onRefreshTokenExpire({ login: B });
|
|
438
438
|
}
|
|
439
|
-
function $(
|
|
440
|
-
if (i &&
|
|
441
|
-
if (
|
|
442
|
-
return Y(
|
|
439
|
+
function $(p = !1) {
|
|
440
|
+
if (i && He(y) && !(E && !p)) {
|
|
441
|
+
if (He(a))
|
|
442
|
+
return Y(p);
|
|
443
443
|
if (s) {
|
|
444
|
-
|
|
445
|
-
if (n instanceof
|
|
444
|
+
U(!0), Yt({ config: t, refreshToken: s }).then((n) => H(n)).catch((n) => {
|
|
445
|
+
if (n instanceof et) {
|
|
446
446
|
if (n.status === 400)
|
|
447
|
-
return Y(
|
|
448
|
-
console.error(n),
|
|
447
|
+
return Y(p);
|
|
448
|
+
console.error(n), b(n.message), p && B();
|
|
449
449
|
} else
|
|
450
|
-
n instanceof Error && (console.error(n),
|
|
450
|
+
n instanceof Error && (console.error(n), b(n.message), p && B());
|
|
451
451
|
}).finally(() => {
|
|
452
|
-
|
|
452
|
+
U(!1);
|
|
453
453
|
});
|
|
454
454
|
return;
|
|
455
455
|
}
|
|
@@ -458,55 +458,55 @@ const me = (r) => {
|
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
z(() => (
|
|
462
|
-
const X =
|
|
461
|
+
z(() => (P = setInterval(() => $(), 1e4), () => clearInterval(P)), [i, s, a, y]);
|
|
462
|
+
const X = Rt(!1);
|
|
463
463
|
return z(() => {
|
|
464
|
-
if (
|
|
465
|
-
const
|
|
466
|
-
if (!
|
|
467
|
-
const n =
|
|
468
|
-
console.error(n),
|
|
464
|
+
if (A) {
|
|
465
|
+
const p = new URLSearchParams(window.location.search);
|
|
466
|
+
if (!p.get("code")) {
|
|
467
|
+
const n = p.get("error_description") || "Estado de autorização inválido. Atualizar a página pode resolver o problema.";
|
|
468
|
+
console.error(n), b(n), L();
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
471
|
if (!X.current) {
|
|
472
472
|
X.current = !0;
|
|
473
473
|
try {
|
|
474
|
-
|
|
474
|
+
Qt(p);
|
|
475
475
|
} catch (n) {
|
|
476
|
-
console.error(n),
|
|
476
|
+
console.error(n), b(n.message);
|
|
477
477
|
}
|
|
478
|
-
|
|
479
|
-
|
|
478
|
+
qt(t).then((n) => {
|
|
479
|
+
H(n), t?.postLogin && t.postLogin();
|
|
480
480
|
}).catch((n) => {
|
|
481
|
-
console.error(n),
|
|
481
|
+
console.error(n), b(n.message);
|
|
482
482
|
}).finally(() => {
|
|
483
|
-
t.clearURL && window.history.replaceState(null, "", window.location.pathname),
|
|
483
|
+
t.clearURL && window.history.replaceState(null, "", window.location.pathname), g(!1);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
return;
|
|
487
487
|
}
|
|
488
488
|
if (!i && t.autoLogin)
|
|
489
|
-
return
|
|
489
|
+
return B();
|
|
490
490
|
try {
|
|
491
|
-
|
|
492
|
-
} catch (
|
|
493
|
-
console.warn(`Falha ao decodificar idToken: ${
|
|
491
|
+
h && N(ge(h));
|
|
492
|
+
} catch (p) {
|
|
493
|
+
console.warn(`Falha ao decodificar idToken: ${p.message}`);
|
|
494
494
|
}
|
|
495
495
|
try {
|
|
496
|
-
t.decodeToken &&
|
|
497
|
-
} catch (
|
|
498
|
-
console.warn(`Falha ao decodificar o token de acesso: ${
|
|
496
|
+
t.decodeToken && O(ge(i));
|
|
497
|
+
} catch (p) {
|
|
498
|
+
console.warn(`Falha ao decodificar o token de acesso: ${p.message}`);
|
|
499
499
|
}
|
|
500
500
|
$(!0);
|
|
501
|
-
}, []), /* @__PURE__ */
|
|
502
|
-
|
|
501
|
+
}, []), /* @__PURE__ */ l(
|
|
502
|
+
sr.Provider,
|
|
503
503
|
{
|
|
504
|
-
value: { token: i, tokenData:
|
|
504
|
+
value: { token: i, tokenData: D, idToken: h, idTokenData: _, login: B, logOut: L, error: x, loginInProgress: A },
|
|
505
505
|
children: e
|
|
506
506
|
}
|
|
507
507
|
);
|
|
508
508
|
};
|
|
509
|
-
class
|
|
509
|
+
class st {
|
|
510
510
|
resourceService;
|
|
511
511
|
resource;
|
|
512
512
|
actions;
|
|
@@ -515,7 +515,7 @@ class tt {
|
|
|
515
515
|
error;
|
|
516
516
|
isAdmin;
|
|
517
517
|
constructor(e, t, s) {
|
|
518
|
-
this.resourceService =
|
|
518
|
+
this.resourceService = kt.getContainer().get(G.Resource), this.resource = { resourceName: e, resourceDescription: t }, this.alreadyApplied = !1, this.actions = [], this.permissions = [], this.error = "", this.isAdmin = s;
|
|
519
519
|
}
|
|
520
520
|
registerAction(e, t) {
|
|
521
521
|
!this.alreadyApplied && this.actions.findIndex((s) => s.actionName === e) < 0 && this.actions.push({ actionName: e, actionDescription: t });
|
|
@@ -588,8 +588,8 @@ class tt {
|
|
|
588
588
|
}
|
|
589
589
|
class V {
|
|
590
590
|
static instance;
|
|
591
|
-
_currentTenant = new
|
|
592
|
-
_availableTenants = new
|
|
591
|
+
_currentTenant = new ze(null);
|
|
592
|
+
_availableTenants = new ze([]);
|
|
593
593
|
constructor() {
|
|
594
594
|
const e = localStorage.getItem("tenant_info");
|
|
595
595
|
if (e)
|
|
@@ -629,15 +629,15 @@ class V {
|
|
|
629
629
|
return t && (e["X-TENANT-ID"] = t.id), e;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function Dr() {
|
|
633
633
|
return V.getInstance();
|
|
634
634
|
}
|
|
635
|
-
var ae = /* @__PURE__ */ ((r) => (r.USER = "user", r.PROFILE = "profile", r.GROUP = "group", r))(ae || {}),
|
|
635
|
+
var ae = /* @__PURE__ */ ((r) => (r.USER = "user", r.PROFILE = "profile", r.GROUP = "group", r))(ae || {}), or = Object.defineProperty, v = (r, e, t, s) => {
|
|
636
636
|
for (var o = void 0, a = r.length - 1, d; a >= 0; a--)
|
|
637
637
|
(d = r[a]) && (o = d(e, t, o) || o);
|
|
638
|
-
return o &&
|
|
639
|
-
},
|
|
640
|
-
const
|
|
638
|
+
return o && or(e, t, o), o;
|
|
639
|
+
}, nr = /* @__PURE__ */ ((r) => (r.VIEW = "VIEW", r.API = "API", r))(nr || {});
|
|
640
|
+
const ot = class nt {
|
|
641
641
|
id;
|
|
642
642
|
code;
|
|
643
643
|
version;
|
|
@@ -648,20 +648,20 @@ const rt = class st {
|
|
|
648
648
|
description;
|
|
649
649
|
intervals;
|
|
650
650
|
constructor(e) {
|
|
651
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.description = e.description || "", this.intervals = e.intervals ? e.intervals.map((t) => new
|
|
651
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.description = e.description || "", this.intervals = e.intervals ? e.intervals.map((t) => new ir(t)) : [];
|
|
652
652
|
}
|
|
653
|
-
static newInstance = () => new
|
|
654
|
-
id:
|
|
653
|
+
static newInstance = () => new nt({
|
|
654
|
+
id: K(),
|
|
655
655
|
intervals: []
|
|
656
656
|
});
|
|
657
657
|
};
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
v([
|
|
659
|
+
J({
|
|
660
660
|
message: "archbase:Informe a descrição do cronograma de acesso"
|
|
661
661
|
})
|
|
662
|
-
],
|
|
663
|
-
let
|
|
664
|
-
const
|
|
662
|
+
], ot.prototype, "description");
|
|
663
|
+
let it = ot;
|
|
664
|
+
const be = class at {
|
|
665
665
|
id;
|
|
666
666
|
code;
|
|
667
667
|
version;
|
|
@@ -674,29 +674,29 @@ const we = class nt {
|
|
|
674
674
|
startTime;
|
|
675
675
|
endTime;
|
|
676
676
|
constructor(e) {
|
|
677
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.accessSchedule = e.accessSchedule ? new
|
|
677
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.accessSchedule = e.accessSchedule ? new it(e.accessSchedule) : void 0, this.dayOfWeek = e.dayOfWeek || 0, this.startTime = e.startTime || "", this.endTime = e.endTime || "";
|
|
678
678
|
}
|
|
679
|
-
static newInstance = () => new
|
|
680
|
-
id:
|
|
679
|
+
static newInstance = () => new at({
|
|
680
|
+
id: K(),
|
|
681
681
|
dayOfWeek: (/* @__PURE__ */ new Date()).getDay(),
|
|
682
682
|
startTime: "08:00",
|
|
683
683
|
endTime: "17:00"
|
|
684
684
|
});
|
|
685
685
|
};
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
],
|
|
689
|
-
|
|
690
|
-
|
|
686
|
+
v([
|
|
687
|
+
re()
|
|
688
|
+
], be.prototype, "accessSchedule");
|
|
689
|
+
v([
|
|
690
|
+
J({
|
|
691
691
|
message: "archbase:Informe a hora de início"
|
|
692
692
|
})
|
|
693
|
-
],
|
|
694
|
-
|
|
695
|
-
|
|
693
|
+
], be.prototype, "startTime");
|
|
694
|
+
v([
|
|
695
|
+
J({
|
|
696
696
|
message: "archbase:Informe a hora de término"
|
|
697
697
|
})
|
|
698
|
-
],
|
|
699
|
-
let
|
|
698
|
+
], be.prototype, "endTime");
|
|
699
|
+
let ir = be;
|
|
700
700
|
class le {
|
|
701
701
|
id;
|
|
702
702
|
code;
|
|
@@ -712,20 +712,20 @@ class le {
|
|
|
712
712
|
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.actions = e.actions || [];
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
|
-
|
|
716
|
-
|
|
715
|
+
v([
|
|
716
|
+
J({
|
|
717
717
|
message: "archbase:Informe o nome"
|
|
718
718
|
})
|
|
719
719
|
], le.prototype, "name");
|
|
720
|
-
|
|
721
|
-
|
|
720
|
+
v([
|
|
721
|
+
J({
|
|
722
722
|
message: "archbase:Informe a descrição"
|
|
723
723
|
})
|
|
724
724
|
], le.prototype, "description");
|
|
725
|
-
|
|
726
|
-
|
|
725
|
+
v([
|
|
726
|
+
re()
|
|
727
727
|
], le.prototype, "actions");
|
|
728
|
-
const de = class
|
|
728
|
+
const de = class ct {
|
|
729
729
|
id;
|
|
730
730
|
code;
|
|
731
731
|
version;
|
|
@@ -741,36 +741,36 @@ const de = class it {
|
|
|
741
741
|
actionVersion;
|
|
742
742
|
isNewAction;
|
|
743
743
|
constructor(e) {
|
|
744
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.resource = e.resource ? new
|
|
744
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.resource = e.resource ? new dt(e.resource) : void 0, this.category = e.category || "", this.active = e.active || !1, this.actionVersion = e.actionVersion || "", this.isNewAction = e.isNewAction || !1;
|
|
745
745
|
}
|
|
746
|
-
static newInstance = () => new
|
|
747
|
-
id:
|
|
746
|
+
static newInstance = () => new ct({
|
|
747
|
+
id: K(),
|
|
748
748
|
active: !0,
|
|
749
749
|
isNewAction: !0
|
|
750
750
|
});
|
|
751
751
|
};
|
|
752
|
-
|
|
753
|
-
|
|
752
|
+
v([
|
|
753
|
+
J({
|
|
754
754
|
message: "archbase:Informe o nome para a ação"
|
|
755
755
|
})
|
|
756
756
|
], de.prototype, "name");
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
v([
|
|
758
|
+
J({
|
|
759
759
|
message: "archbase:Informe a descrição para a ação"
|
|
760
760
|
})
|
|
761
761
|
], de.prototype, "description");
|
|
762
|
-
|
|
763
|
-
|
|
762
|
+
v([
|
|
763
|
+
re()
|
|
764
764
|
], de.prototype, "resource");
|
|
765
|
-
|
|
766
|
-
|
|
765
|
+
v([
|
|
766
|
+
J({
|
|
767
767
|
message: "archbase:Informe a categoria para a ação"
|
|
768
768
|
})
|
|
769
769
|
], de.prototype, "category");
|
|
770
|
-
|
|
771
|
-
|
|
770
|
+
v([
|
|
771
|
+
q()
|
|
772
772
|
], de.prototype, "active");
|
|
773
|
-
let
|
|
773
|
+
let ar = de;
|
|
774
774
|
class ue extends le {
|
|
775
775
|
type;
|
|
776
776
|
isNewProfile;
|
|
@@ -778,11 +778,11 @@ class ue extends le {
|
|
|
778
778
|
super(e), this.type = ae.PROFILE, this.isNewProfile = e.isNewProfile || !1;
|
|
779
779
|
}
|
|
780
780
|
static newInstance = () => new ue({
|
|
781
|
-
id:
|
|
781
|
+
id: K(),
|
|
782
782
|
isNewProfile: !0
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
|
-
class
|
|
785
|
+
class Be {
|
|
786
786
|
id;
|
|
787
787
|
code;
|
|
788
788
|
version;
|
|
@@ -794,8 +794,8 @@ class Re {
|
|
|
794
794
|
constructor(e) {
|
|
795
795
|
this.id = e.id, this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.group = e.group ? new he(e.group) : void 0;
|
|
796
796
|
}
|
|
797
|
-
static newInstance = (e) => new
|
|
798
|
-
id:
|
|
797
|
+
static newInstance = (e) => new Be({
|
|
798
|
+
id: K(),
|
|
799
799
|
group: e
|
|
800
800
|
});
|
|
801
801
|
}
|
|
@@ -806,11 +806,11 @@ class he extends le {
|
|
|
806
806
|
super(e), this.type = ae.GROUP, this.isNewGroup = e.isNewGroup || !1;
|
|
807
807
|
}
|
|
808
808
|
static newInstance = () => new he({
|
|
809
|
-
id:
|
|
809
|
+
id: K(),
|
|
810
810
|
isNewGroup: !0
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
-
const
|
|
813
|
+
const Ae = class lt {
|
|
814
814
|
id;
|
|
815
815
|
code;
|
|
816
816
|
version;
|
|
@@ -827,28 +827,28 @@ const ve = class at {
|
|
|
827
827
|
constructor(e) {
|
|
828
828
|
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.actions = e.actions || [], this.active = e.active || !1, this.type = e.type || "VIEW", this.isNewResource = e.isNewResource || !1;
|
|
829
829
|
}
|
|
830
|
-
static newInstance = () => new
|
|
831
|
-
id:
|
|
830
|
+
static newInstance = () => new lt({
|
|
831
|
+
id: K(),
|
|
832
832
|
actions: [],
|
|
833
833
|
active: !0,
|
|
834
834
|
isNewResource: !0
|
|
835
835
|
});
|
|
836
836
|
};
|
|
837
|
-
|
|
838
|
-
|
|
837
|
+
v([
|
|
838
|
+
J({
|
|
839
839
|
message: "archbase:Informe o nome para o recurso"
|
|
840
840
|
})
|
|
841
|
-
],
|
|
842
|
-
|
|
843
|
-
|
|
841
|
+
], Ae.prototype, "name");
|
|
842
|
+
v([
|
|
843
|
+
J({
|
|
844
844
|
message: "archbase:Informe a descrição para o recurso"
|
|
845
845
|
})
|
|
846
|
-
],
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
],
|
|
850
|
-
let
|
|
851
|
-
const M = class
|
|
846
|
+
], Ae.prototype, "description");
|
|
847
|
+
v([
|
|
848
|
+
q()
|
|
849
|
+
], Ae.prototype, "active");
|
|
850
|
+
let dt = Ae;
|
|
851
|
+
const M = class ut extends le {
|
|
852
852
|
userName;
|
|
853
853
|
password;
|
|
854
854
|
changePasswordOnNextLogin;
|
|
@@ -868,10 +868,10 @@ const M = class lt extends le {
|
|
|
868
868
|
type;
|
|
869
869
|
isNewUser;
|
|
870
870
|
constructor(e) {
|
|
871
|
-
super(e), this.type = ae.USER, this.userName = e.userName || "", this.password = e.password || "", this.changePasswordOnNextLogin = e.changePasswordOnNextLogin || !1, this.allowPasswordChange = e.allowPasswordChange || !1, this.allowMultipleLogins = e.allowMultipleLogins || !1, this.passwordNeverExpires = e.passwordNeverExpires || !1, this.accountDeactivated = e.accountDeactivated || !1, this.accountLocked = e.accountLocked || !1, this.unlimitedAccessHours = e.unlimitedAccessHours || !1, this.isAdministrator = e.isAdministrator || !1, this.accessSchedule = e.accessSchedule ? new
|
|
871
|
+
super(e), this.type = ae.USER, this.userName = e.userName || "", this.password = e.password || "", this.changePasswordOnNextLogin = e.changePasswordOnNextLogin || !1, this.allowPasswordChange = e.allowPasswordChange || !1, this.allowMultipleLogins = e.allowMultipleLogins || !1, this.passwordNeverExpires = e.passwordNeverExpires || !1, this.accountDeactivated = e.accountDeactivated || !1, this.accountLocked = e.accountLocked || !1, this.unlimitedAccessHours = e.unlimitedAccessHours || !1, this.isAdministrator = e.isAdministrator || !1, this.accessSchedule = e.accessSchedule ? new it(e.accessSchedule) : void 0, this.groups = e.groups ? e.groups.map((t) => new Be(t)) : [], this.profile = e.profile ? new ue(e.profile) : void 0, this.email = e.email || "", this.avatar = e.avatar || void 0, this.isNewUser = e.isNewUser || !1, this.nickname = e.nickname;
|
|
872
872
|
}
|
|
873
|
-
static newInstance = () => new
|
|
874
|
-
id:
|
|
873
|
+
static newInstance = () => new ut({
|
|
874
|
+
id: K(),
|
|
875
875
|
userName: "",
|
|
876
876
|
password: "",
|
|
877
877
|
groups: [],
|
|
@@ -882,54 +882,54 @@ const M = class lt extends le {
|
|
|
882
882
|
isNewUser: !0
|
|
883
883
|
});
|
|
884
884
|
};
|
|
885
|
-
|
|
886
|
-
|
|
885
|
+
v([
|
|
886
|
+
J({
|
|
887
887
|
message: "archbase:Informe o nome de usuário"
|
|
888
888
|
})
|
|
889
889
|
], M.prototype, "userName");
|
|
890
|
-
|
|
891
|
-
|
|
890
|
+
v([
|
|
891
|
+
q()
|
|
892
892
|
], M.prototype, "changePasswordOnNextLogin");
|
|
893
|
-
|
|
894
|
-
|
|
893
|
+
v([
|
|
894
|
+
q()
|
|
895
895
|
], M.prototype, "allowPasswordChange");
|
|
896
|
-
|
|
897
|
-
|
|
896
|
+
v([
|
|
897
|
+
q()
|
|
898
898
|
], M.prototype, "allowMultipleLogins");
|
|
899
|
-
|
|
900
|
-
|
|
899
|
+
v([
|
|
900
|
+
q()
|
|
901
901
|
], M.prototype, "passwordNeverExpires");
|
|
902
|
-
|
|
903
|
-
|
|
902
|
+
v([
|
|
903
|
+
q()
|
|
904
904
|
], M.prototype, "accountDeactivated");
|
|
905
|
-
|
|
906
|
-
|
|
905
|
+
v([
|
|
906
|
+
q()
|
|
907
907
|
], M.prototype, "accountLocked");
|
|
908
|
-
|
|
909
|
-
|
|
908
|
+
v([
|
|
909
|
+
q()
|
|
910
910
|
], M.prototype, "unlimitedAccessHours");
|
|
911
|
-
|
|
912
|
-
|
|
911
|
+
v([
|
|
912
|
+
q()
|
|
913
913
|
], M.prototype, "isAdministrator");
|
|
914
|
-
|
|
915
|
-
|
|
914
|
+
v([
|
|
915
|
+
re()
|
|
916
916
|
], M.prototype, "accessSchedule");
|
|
917
|
-
|
|
918
|
-
|
|
917
|
+
v([
|
|
918
|
+
re()
|
|
919
919
|
], M.prototype, "groups");
|
|
920
|
-
|
|
921
|
-
|
|
920
|
+
v([
|
|
921
|
+
re()
|
|
922
922
|
], M.prototype, "profile");
|
|
923
|
-
|
|
924
|
-
|
|
923
|
+
v([
|
|
924
|
+
It(
|
|
925
925
|
{},
|
|
926
926
|
{
|
|
927
927
|
message: "archbase:Informe um email válido"
|
|
928
928
|
}
|
|
929
929
|
)
|
|
930
930
|
], M.prototype, "email");
|
|
931
|
-
let
|
|
932
|
-
const
|
|
931
|
+
let Ee = M;
|
|
932
|
+
const Me = class _e {
|
|
933
933
|
id;
|
|
934
934
|
code;
|
|
935
935
|
version;
|
|
@@ -943,7 +943,7 @@ const Ne = class Ue {
|
|
|
943
943
|
companyId;
|
|
944
944
|
projectId;
|
|
945
945
|
constructor(e) {
|
|
946
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.security = e.security ?
|
|
946
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.security = e.security ? _e.createDtoFromJson(e.security) : void 0, this.action = e.action ? new ar(e.action) : void 0, this.tenantId = e.tenantId || "", this.companyId = e.companyId || "", this.projectId = e.projectId || "";
|
|
947
947
|
}
|
|
948
948
|
static createDtoFromJson(e) {
|
|
949
949
|
switch (e.type) {
|
|
@@ -952,26 +952,26 @@ const Ne = class Ue {
|
|
|
952
952
|
case "group":
|
|
953
953
|
return new he(e);
|
|
954
954
|
case "user":
|
|
955
|
-
return new
|
|
955
|
+
return new Ee(e);
|
|
956
956
|
default:
|
|
957
957
|
throw new Error("Unknown DTO type");
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
static newInstance = () => new
|
|
961
|
-
id:
|
|
960
|
+
static newInstance = () => new _e({
|
|
961
|
+
id: K(),
|
|
962
962
|
tenantId: "",
|
|
963
963
|
companyId: "",
|
|
964
964
|
projectId: ""
|
|
965
965
|
});
|
|
966
966
|
};
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
],
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
],
|
|
973
|
-
let
|
|
974
|
-
class
|
|
967
|
+
v([
|
|
968
|
+
re()
|
|
969
|
+
], Me.prototype, "security");
|
|
970
|
+
v([
|
|
971
|
+
re()
|
|
972
|
+
], Me.prototype, "action");
|
|
973
|
+
let _r = Me;
|
|
974
|
+
class Oe {
|
|
975
975
|
id;
|
|
976
976
|
code;
|
|
977
977
|
version;
|
|
@@ -989,13 +989,13 @@ class Me {
|
|
|
989
989
|
activated;
|
|
990
990
|
isNovoToken;
|
|
991
991
|
constructor(e) {
|
|
992
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.tenantId = e.tenantId || "", this.user = e.user ? new
|
|
992
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.tenantId = e.tenantId || "", this.user = e.user ? new Ee(e.user) : void 0, this.name = e.name || "", this.description = e.description || "", this.token = e.token || "", this.expirationDate = e.expirationDate, this.revoked = e.revoked, this.activated = e.activated || !1;
|
|
993
993
|
}
|
|
994
|
-
static newInstance = () => new
|
|
995
|
-
id:
|
|
994
|
+
static newInstance = () => new Oe({
|
|
995
|
+
id: K()
|
|
996
996
|
});
|
|
997
997
|
}
|
|
998
|
-
class
|
|
998
|
+
class Le {
|
|
999
999
|
id;
|
|
1000
1000
|
code;
|
|
1001
1001
|
version;
|
|
@@ -1012,15 +1012,15 @@ class Be {
|
|
|
1012
1012
|
user;
|
|
1013
1013
|
isNewAccessToken;
|
|
1014
1014
|
constructor(e) {
|
|
1015
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.token = e.token || "", this.tokenType = e.tokenType || void 0, this.user = e.user ? new
|
|
1015
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.token = e.token || "", this.tokenType = e.tokenType || void 0, this.user = e.user ? new Ee(e.user) : void 0, this.revoked = e.revoked || !1, this.expired = e.expired || !1, this.expirationTime = e.expirationTime || 0, this.expirationDate = e.expirationDate || "", this.isNewAccessToken = e.isNewAccessToken || !1;
|
|
1016
1016
|
}
|
|
1017
|
-
static newInstance = () => new
|
|
1018
|
-
id:
|
|
1017
|
+
static newInstance = () => new Le({
|
|
1018
|
+
id: K(),
|
|
1019
1019
|
active: !0,
|
|
1020
1020
|
isNewAccessToken: !0
|
|
1021
1021
|
});
|
|
1022
1022
|
}
|
|
1023
|
-
class
|
|
1023
|
+
class ht extends ce {
|
|
1024
1024
|
constructor(e) {
|
|
1025
1025
|
super(e);
|
|
1026
1026
|
}
|
|
@@ -1028,7 +1028,7 @@ class dt extends ce {
|
|
|
1028
1028
|
return V.getInstance().getHeaders();
|
|
1029
1029
|
}
|
|
1030
1030
|
transform(e) {
|
|
1031
|
-
return new
|
|
1031
|
+
return new Ee(e);
|
|
1032
1032
|
}
|
|
1033
1033
|
getEndpoint() {
|
|
1034
1034
|
return "/api/v1/user";
|
|
@@ -1047,9 +1047,9 @@ class dt extends ce {
|
|
|
1047
1047
|
return this.transform(t);
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
|
-
I.decorate(I.inject(
|
|
1051
|
-
I.decorate(I.injectable(),
|
|
1052
|
-
class
|
|
1050
|
+
I.decorate(I.inject(G.ApiClient), ht, 0);
|
|
1051
|
+
I.decorate(I.injectable(), ht);
|
|
1052
|
+
class pt extends ce {
|
|
1053
1053
|
constructor(e) {
|
|
1054
1054
|
super(e);
|
|
1055
1055
|
}
|
|
@@ -1069,9 +1069,9 @@ class ut extends ce {
|
|
|
1069
1069
|
return e.isNewGroup;
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
|
-
I.decorate(I.inject(
|
|
1073
|
-
I.decorate(I.injectable(),
|
|
1074
|
-
class
|
|
1072
|
+
I.decorate(I.inject(G.ApiClient), pt, 0);
|
|
1073
|
+
I.decorate(I.injectable(), pt);
|
|
1074
|
+
class ft extends ce {
|
|
1075
1075
|
constructor(e) {
|
|
1076
1076
|
super(e);
|
|
1077
1077
|
}
|
|
@@ -1091,9 +1091,9 @@ class ht extends ce {
|
|
|
1091
1091
|
return e.isNewProfile;
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
|
-
I.decorate(I.inject(
|
|
1095
|
-
I.decorate(I.injectable(),
|
|
1096
|
-
class
|
|
1094
|
+
I.decorate(I.inject(G.ApiClient), ft, 0);
|
|
1095
|
+
I.decorate(I.injectable(), ft);
|
|
1096
|
+
class mt extends ce {
|
|
1097
1097
|
constructor(e) {
|
|
1098
1098
|
super(e);
|
|
1099
1099
|
}
|
|
@@ -1101,7 +1101,7 @@ class pt extends ce {
|
|
|
1101
1101
|
return V.getInstance().getHeaders();
|
|
1102
1102
|
}
|
|
1103
1103
|
transform(e) {
|
|
1104
|
-
return new
|
|
1104
|
+
return new Oe(e);
|
|
1105
1105
|
}
|
|
1106
1106
|
getEndpoint() {
|
|
1107
1107
|
return "/api/v1/apiToken";
|
|
@@ -1128,9 +1128,9 @@ class pt extends ce {
|
|
|
1128
1128
|
);
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
|
-
I.decorate(I.inject(
|
|
1132
|
-
I.decorate(I.injectable(),
|
|
1133
|
-
class
|
|
1131
|
+
I.decorate(I.inject(G.ApiClient), mt, 0);
|
|
1132
|
+
I.decorate(I.injectable(), mt);
|
|
1133
|
+
class gt extends ce {
|
|
1134
1134
|
constructor(e) {
|
|
1135
1135
|
super(e);
|
|
1136
1136
|
}
|
|
@@ -1138,7 +1138,7 @@ class ft extends ce {
|
|
|
1138
1138
|
return V.getInstance().getHeaders();
|
|
1139
1139
|
}
|
|
1140
1140
|
transform(e) {
|
|
1141
|
-
return new
|
|
1141
|
+
return new Le(e);
|
|
1142
1142
|
}
|
|
1143
1143
|
getEndpoint() {
|
|
1144
1144
|
return "/api/v1/accessToken";
|
|
@@ -1157,9 +1157,9 @@ class ft extends ce {
|
|
|
1157
1157
|
);
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
I.decorate(I.inject(
|
|
1161
|
-
I.decorate(I.injectable(),
|
|
1162
|
-
class
|
|
1160
|
+
I.decorate(I.inject(G.ApiClient), gt, 0);
|
|
1161
|
+
I.decorate(I.injectable(), gt);
|
|
1162
|
+
class yt extends ce {
|
|
1163
1163
|
constructor(e) {
|
|
1164
1164
|
super(e);
|
|
1165
1165
|
}
|
|
@@ -1167,7 +1167,7 @@ class mt extends ce {
|
|
|
1167
1167
|
return V.getInstance().getHeaders();
|
|
1168
1168
|
}
|
|
1169
1169
|
transform(e) {
|
|
1170
|
-
return new
|
|
1170
|
+
return new dt(e);
|
|
1171
1171
|
}
|
|
1172
1172
|
getEndpoint() {
|
|
1173
1173
|
return "/api/v1/resource";
|
|
@@ -1191,7 +1191,7 @@ class mt extends ce {
|
|
|
1191
1191
|
!1,
|
|
1192
1192
|
{
|
|
1193
1193
|
params: {
|
|
1194
|
-
type:
|
|
1194
|
+
type: Ve(ae, t)
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
1197
|
);
|
|
@@ -1202,7 +1202,7 @@ class mt extends ce {
|
|
|
1202
1202
|
{
|
|
1203
1203
|
securityId: e,
|
|
1204
1204
|
actionId: t,
|
|
1205
|
-
type:
|
|
1205
|
+
type: Ve(ae, s)
|
|
1206
1206
|
},
|
|
1207
1207
|
this.configureHeaders()
|
|
1208
1208
|
);
|
|
@@ -1221,9 +1221,9 @@ class mt extends ce {
|
|
|
1221
1221
|
);
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
I.decorate(I.inject(
|
|
1225
|
-
I.decorate(I.injectable(),
|
|
1226
|
-
function
|
|
1224
|
+
I.decorate(I.inject(G.ApiClient), yt, 0);
|
|
1225
|
+
I.decorate(I.injectable(), yt);
|
|
1226
|
+
function Rr({
|
|
1227
1227
|
onLogin: r,
|
|
1228
1228
|
error: e,
|
|
1229
1229
|
onClickForgotPassword: t,
|
|
@@ -1232,149 +1232,149 @@ function Cr({
|
|
|
1232
1232
|
afterInputs: a,
|
|
1233
1233
|
showMockUsersSelector: d = !1,
|
|
1234
1234
|
mockUsers: i = [],
|
|
1235
|
-
mockUsersGroupMap:
|
|
1236
|
-
options:
|
|
1237
|
-
onChangeUsername:
|
|
1238
|
-
disabledLogin:
|
|
1239
|
-
isCheckingUsername:
|
|
1240
|
-
showSignIn:
|
|
1235
|
+
mockUsersGroupMap: u,
|
|
1236
|
+
options: y = {},
|
|
1237
|
+
onChangeUsername: k,
|
|
1238
|
+
disabledLogin: h = !1,
|
|
1239
|
+
isCheckingUsername: C = !1,
|
|
1240
|
+
showSignIn: A = !0
|
|
1241
1241
|
}) {
|
|
1242
|
-
const
|
|
1243
|
-
username:
|
|
1244
|
-
password:
|
|
1245
|
-
rememberMe:
|
|
1246
|
-
clearRememberMe:
|
|
1247
|
-
} =
|
|
1242
|
+
const g = Ye(), {
|
|
1243
|
+
username: E,
|
|
1244
|
+
password: U,
|
|
1245
|
+
rememberMe: D,
|
|
1246
|
+
clearRememberMe: O
|
|
1247
|
+
} = Pt(), [_, N] = f(E), [x, b] = f(U), [P, W] = f(D), [L, B] = f(!1), [H, Y] = f(null);
|
|
1248
1248
|
z(() => {
|
|
1249
|
-
|
|
1249
|
+
B(!!e);
|
|
1250
1250
|
}, [e]), z(() => {
|
|
1251
|
-
|
|
1252
|
-
}, [
|
|
1251
|
+
E !== _ && (N(E), k?.(E)), U !== x && b(U), D !== P && W(D);
|
|
1252
|
+
}, [E, U, D]);
|
|
1253
1253
|
const $ = () => {
|
|
1254
|
-
|
|
1254
|
+
B(!1);
|
|
1255
1255
|
}, X = () => {
|
|
1256
|
-
|
|
1257
|
-
},
|
|
1258
|
-
if (!
|
|
1259
|
-
return i.map((
|
|
1260
|
-
value:
|
|
1261
|
-
label:
|
|
1256
|
+
_ && x && r(_, x, P).finally(() => B(!0));
|
|
1257
|
+
}, p = () => {
|
|
1258
|
+
if (!u)
|
|
1259
|
+
return i.map((m) => ({
|
|
1260
|
+
value: m.email,
|
|
1261
|
+
label: m.email
|
|
1262
1262
|
}));
|
|
1263
|
-
const c = i.reduce((
|
|
1264
|
-
const j =
|
|
1265
|
-
return j && (
|
|
1263
|
+
const c = i.reduce((m, T) => {
|
|
1264
|
+
const j = u[T.type];
|
|
1265
|
+
return j && (m[j] || (m[j] = []), m[j].push({
|
|
1266
1266
|
value: T.email,
|
|
1267
1267
|
label: T.email
|
|
1268
|
-
})),
|
|
1268
|
+
})), m;
|
|
1269
1269
|
}, {});
|
|
1270
|
-
return Object.entries(c).map(([
|
|
1271
|
-
group:
|
|
1270
|
+
return Object.entries(c).map(([m, T]) => ({
|
|
1271
|
+
group: m,
|
|
1272
1272
|
items: T
|
|
1273
1273
|
}));
|
|
1274
1274
|
}, n = () => {
|
|
1275
|
-
if (
|
|
1276
|
-
const c = i.find((
|
|
1277
|
-
c && (
|
|
1275
|
+
if (H) {
|
|
1276
|
+
const c = i.find((m) => m.email === H);
|
|
1277
|
+
c && (N(c.email), b(c.password), $());
|
|
1278
1278
|
}
|
|
1279
|
-
},
|
|
1279
|
+
}, w = {
|
|
1280
1280
|
withBorder: !0,
|
|
1281
1281
|
shadow: "md",
|
|
1282
1282
|
p: 30,
|
|
1283
1283
|
mt: 30,
|
|
1284
1284
|
radius: "md",
|
|
1285
1285
|
w: 400,
|
|
1286
|
-
...
|
|
1286
|
+
...y.cardProps
|
|
1287
1287
|
};
|
|
1288
|
-
return /* @__PURE__ */
|
|
1289
|
-
|
|
1288
|
+
return /* @__PURE__ */ R(
|
|
1289
|
+
Ke,
|
|
1290
1290
|
{
|
|
1291
|
-
...
|
|
1291
|
+
...w,
|
|
1292
1292
|
pos: "relative",
|
|
1293
|
-
ref:
|
|
1293
|
+
ref: g,
|
|
1294
1294
|
children: [
|
|
1295
|
-
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
|
|
1295
|
+
A && /* @__PURE__ */ R(te, { children: [
|
|
1296
|
+
/* @__PURE__ */ l(
|
|
1297
|
+
se,
|
|
1298
1298
|
{
|
|
1299
1299
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1300
1300
|
fw: 800,
|
|
1301
1301
|
fz: { base: "20px", md: "35px" },
|
|
1302
1302
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1303
1303
|
mt: "xs",
|
|
1304
|
-
children:
|
|
1304
|
+
children: S().t("archbase:signIn")
|
|
1305
1305
|
}
|
|
1306
1306
|
),
|
|
1307
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ l(ye, { m: "md" })
|
|
1308
1308
|
] }),
|
|
1309
|
-
|
|
1310
|
-
d && /* @__PURE__ */
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */
|
|
1313
|
-
|
|
1309
|
+
y?.customContentBefore,
|
|
1310
|
+
d && /* @__PURE__ */ R(te, { children: [
|
|
1311
|
+
/* @__PURE__ */ R(we, { gap: "sm", mb: "md", children: [
|
|
1312
|
+
/* @__PURE__ */ l(
|
|
1313
|
+
Nt,
|
|
1314
1314
|
{
|
|
1315
1315
|
placeholder: "Selecione um usuário mock",
|
|
1316
|
-
data:
|
|
1317
|
-
value:
|
|
1316
|
+
data: p(),
|
|
1317
|
+
value: H,
|
|
1318
1318
|
onChange: Y,
|
|
1319
1319
|
searchable: !0,
|
|
1320
1320
|
clearable: !0,
|
|
1321
1321
|
style: { flexGrow: 1 }
|
|
1322
1322
|
}
|
|
1323
1323
|
),
|
|
1324
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ l(Bt, { label: "Aplicar", children: /* @__PURE__ */ l(
|
|
1325
1325
|
ie,
|
|
1326
1326
|
{
|
|
1327
1327
|
variant: "light",
|
|
1328
1328
|
size: "sm",
|
|
1329
1329
|
onClick: n,
|
|
1330
|
-
disabled: !
|
|
1330
|
+
disabled: !H,
|
|
1331
1331
|
"aria-label": "Aplicar usuário mock selecionado",
|
|
1332
|
-
children: /* @__PURE__ */
|
|
1332
|
+
children: /* @__PURE__ */ l(Ft, { size: 16 })
|
|
1333
1333
|
}
|
|
1334
1334
|
) })
|
|
1335
1335
|
] }),
|
|
1336
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ l(ye, { mb: "md" })
|
|
1337
1337
|
] }),
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
|
|
1338
|
+
/* @__PURE__ */ l(
|
|
1339
|
+
Ce,
|
|
1340
1340
|
{
|
|
1341
1341
|
label: s,
|
|
1342
|
-
placeholder: o ??
|
|
1343
|
-
rightSection:
|
|
1344
|
-
value:
|
|
1342
|
+
placeholder: o ?? S().t("archbase:usuario@email.com"),
|
|
1343
|
+
rightSection: C ? /* @__PURE__ */ l(qe, { size: "xs" }) : null,
|
|
1344
|
+
value: _ || "",
|
|
1345
1345
|
required: !0,
|
|
1346
1346
|
onChange: (c) => {
|
|
1347
|
-
|
|
1347
|
+
N(c.currentTarget.value), k?.(c.currentTarget.value), $();
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
),
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
|
|
1351
|
+
/* @__PURE__ */ l(
|
|
1352
|
+
Ue,
|
|
1353
1353
|
{
|
|
1354
|
-
label:
|
|
1355
|
-
placeholder:
|
|
1354
|
+
label: S().t("archbase:Password"),
|
|
1355
|
+
placeholder: S().t("archbase:Sua senha"),
|
|
1356
1356
|
onChange: (c) => {
|
|
1357
|
-
|
|
1357
|
+
b(c.currentTarget.value), $();
|
|
1358
1358
|
},
|
|
1359
|
-
value:
|
|
1359
|
+
value: x || "",
|
|
1360
1360
|
required: !0,
|
|
1361
1361
|
mt: "md"
|
|
1362
1362
|
}
|
|
1363
1363
|
),
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ R(we, { justify: "space-between", mt: "md", children: [
|
|
1365
|
+
/* @__PURE__ */ l(
|
|
1366
1366
|
Mt,
|
|
1367
1367
|
{
|
|
1368
|
-
label:
|
|
1369
|
-
checked:
|
|
1368
|
+
label: S().t("archbase:Lembre-me"),
|
|
1369
|
+
checked: P,
|
|
1370
1370
|
onChange: (c) => {
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1371
|
+
const m = c.currentTarget.checked;
|
|
1372
|
+
W(m), m || O();
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
1375
|
),
|
|
1376
|
-
t && /* @__PURE__ */
|
|
1377
|
-
|
|
1376
|
+
t && /* @__PURE__ */ l(
|
|
1377
|
+
Ot,
|
|
1378
1378
|
{
|
|
1379
1379
|
component: "button",
|
|
1380
1380
|
c: "var(--mantine-text-color)",
|
|
@@ -1382,213 +1382,213 @@ function Cr({
|
|
|
1382
1382
|
lh: "20px",
|
|
1383
1383
|
styles: { root: { cursor: "pointer" } },
|
|
1384
1384
|
onClick: t,
|
|
1385
|
-
children:
|
|
1385
|
+
children: S().t("archbase:Esqueci minha senha")
|
|
1386
1386
|
}
|
|
1387
1387
|
)
|
|
1388
1388
|
] }),
|
|
1389
|
-
|
|
1390
|
-
/* @__PURE__ */
|
|
1389
|
+
y?.afterInputs || a,
|
|
1390
|
+
/* @__PURE__ */ l(
|
|
1391
1391
|
ie,
|
|
1392
1392
|
{
|
|
1393
|
-
disabled: !
|
|
1393
|
+
disabled: !x || !_ || h,
|
|
1394
1394
|
fullWidth: !0,
|
|
1395
1395
|
mt: "xl",
|
|
1396
1396
|
onClick: X,
|
|
1397
|
-
children:
|
|
1397
|
+
children: S().t("archbase:signIn")
|
|
1398
1398
|
}
|
|
1399
1399
|
),
|
|
1400
|
-
|
|
1401
|
-
|
|
1400
|
+
y?.customContentAfter,
|
|
1401
|
+
L && e && /* @__PURE__ */ l(se, { c: "red", mt: "sm", children: e })
|
|
1402
1402
|
]
|
|
1403
1403
|
}
|
|
1404
1404
|
);
|
|
1405
1405
|
}
|
|
1406
|
-
const
|
|
1406
|
+
const cr = {
|
|
1407
1407
|
position: "relative",
|
|
1408
1408
|
width: "90%",
|
|
1409
1409
|
maxWidth: 400,
|
|
1410
1410
|
padding: 30,
|
|
1411
1411
|
marginTop: 30
|
|
1412
1412
|
};
|
|
1413
|
-
function
|
|
1414
|
-
const
|
|
1413
|
+
function Nr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClickBackToLogin: s, validatePassword: o, validateToken: a, initialEmail: d = "", description: i, style: u }) {
|
|
1414
|
+
const y = Ye(), k = Tt(), { colorScheme: h } = Lt(), [C, A] = f(r ?? ""), [g, E] = f(d), [U, D] = f(""), [O, _] = f(""), [N, x] = f(""), [b, P] = f(!1), [W, L] = f(""), [B, H] = f(""), [Y, $] = f(""), [X, p] = f("");
|
|
1415
1415
|
async function n(c) {
|
|
1416
|
-
c && (
|
|
1417
|
-
|
|
1416
|
+
c && (Ct(c) ? await e(c).then(() => {
|
|
1417
|
+
We.showSuccess(`${S().t("archbase:Um e-mail com instruções para redefinir sua senha foi enviado. Verifique sua caixa de entrada.")}`), P(!0);
|
|
1418
1418
|
}).catch(() => {
|
|
1419
|
-
}) :
|
|
1419
|
+
}) : L(`${S().t("archbase:Email inválido")}`));
|
|
1420
1420
|
}
|
|
1421
|
-
async function
|
|
1422
|
-
if (c &&
|
|
1423
|
-
let
|
|
1424
|
-
a && (
|
|
1425
|
-
|
|
1421
|
+
async function w(c, m, T, j) {
|
|
1422
|
+
if (c && m && T) {
|
|
1423
|
+
let xe = "", Se = "", Fe = "";
|
|
1424
|
+
a && (xe = a(), $(xe)), o && (Se = o(), $(Se)), T !== j && (Fe = `${S().t("archbase:A nova senha e a confirmação devem ser iguais.")}`, p(Fe)), !Se && !xe && await t(c, m, T).then(() => {
|
|
1425
|
+
We.showSuccess(`${S().t("archbase:Senha redefinida com sucesso.")}`), s(), P(!1);
|
|
1426
1426
|
}).catch(() => {
|
|
1427
|
-
|
|
1427
|
+
A(r || `${S().t("archbase:Erro ao redefinir senha.")}`);
|
|
1428
1428
|
});
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
1431
|
return z(() => {
|
|
1432
|
-
r &&
|
|
1432
|
+
r && A(r);
|
|
1433
1433
|
}, [r]), z(() => {
|
|
1434
|
-
|
|
1435
|
-
}, [
|
|
1436
|
-
|
|
1434
|
+
A("");
|
|
1435
|
+
}, [g, U, O, N]), /* @__PURE__ */ R(
|
|
1436
|
+
Ke,
|
|
1437
1437
|
{
|
|
1438
1438
|
withBorder: !0,
|
|
1439
1439
|
shadow: "md",
|
|
1440
1440
|
radius: "md",
|
|
1441
|
-
ref:
|
|
1441
|
+
ref: y,
|
|
1442
1442
|
style: {
|
|
1443
|
-
...
|
|
1444
|
-
...
|
|
1443
|
+
...cr,
|
|
1444
|
+
...u
|
|
1445
1445
|
},
|
|
1446
1446
|
children: [
|
|
1447
|
-
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
|
|
1447
|
+
b ? /* @__PURE__ */ R(te, { children: [
|
|
1448
|
+
/* @__PURE__ */ l(
|
|
1449
|
+
se,
|
|
1450
1450
|
{
|
|
1451
1451
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1452
1452
|
fw: 800,
|
|
1453
1453
|
fz: { base: "20px", md: "35px" },
|
|
1454
1454
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1455
1455
|
mt: "xs",
|
|
1456
|
-
children:
|
|
1456
|
+
children: S().t("archbase:Redefinir senha")
|
|
1457
1457
|
}
|
|
1458
1458
|
),
|
|
1459
|
-
/* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
|
|
1459
|
+
/* @__PURE__ */ l(ye, { m: "xs" }),
|
|
1460
|
+
/* @__PURE__ */ l(
|
|
1461
|
+
Ce,
|
|
1462
1462
|
{
|
|
1463
|
-
label:
|
|
1464
|
-
placeholder: `${
|
|
1465
|
-
value:
|
|
1463
|
+
label: S().t("archbase:Código de segurança"),
|
|
1464
|
+
placeholder: `${S().t("archbase:Código enviado no seu e-mail")}`,
|
|
1465
|
+
value: U || "",
|
|
1466
1466
|
required: !0,
|
|
1467
1467
|
onChange: (c) => {
|
|
1468
|
-
|
|
1468
|
+
D(c.currentTarget.value), H("");
|
|
1469
1469
|
},
|
|
1470
|
-
error:
|
|
1470
|
+
error: B
|
|
1471
1471
|
}
|
|
1472
1472
|
),
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
|
|
1473
|
+
/* @__PURE__ */ l(
|
|
1474
|
+
Ue,
|
|
1475
1475
|
{
|
|
1476
|
-
label:
|
|
1477
|
-
placeholder:
|
|
1476
|
+
label: S().t("archbase:Nova senha"),
|
|
1477
|
+
placeholder: S().t("archbase:Nova senha"),
|
|
1478
1478
|
onChange: (c) => {
|
|
1479
|
-
|
|
1479
|
+
_(c.currentTarget.value), $(""), p("");
|
|
1480
1480
|
},
|
|
1481
|
-
value:
|
|
1481
|
+
value: O,
|
|
1482
1482
|
required: !0,
|
|
1483
1483
|
error: Y
|
|
1484
1484
|
}
|
|
1485
1485
|
),
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
|
|
1486
|
+
/* @__PURE__ */ l(
|
|
1487
|
+
Ue,
|
|
1488
1488
|
{
|
|
1489
|
-
label:
|
|
1490
|
-
placeholder:
|
|
1489
|
+
label: S().t("archbase:Confirmar senha"),
|
|
1490
|
+
placeholder: S().t("archbase:Confirmar senha"),
|
|
1491
1491
|
onChange: (c) => {
|
|
1492
|
-
|
|
1492
|
+
x(c.currentTarget.value), p("");
|
|
1493
1493
|
},
|
|
1494
|
-
value:
|
|
1494
|
+
value: N || "",
|
|
1495
1495
|
required: !0,
|
|
1496
1496
|
error: X
|
|
1497
1497
|
}
|
|
1498
1498
|
),
|
|
1499
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ l(
|
|
1500
1500
|
ie,
|
|
1501
1501
|
{
|
|
1502
|
-
disabled: !
|
|
1502
|
+
disabled: !g || !U || !O || !N,
|
|
1503
1503
|
mt: "md",
|
|
1504
1504
|
fullWidth: !0,
|
|
1505
|
-
onClick: () =>
|
|
1506
|
-
children: `${
|
|
1505
|
+
onClick: () => w(g, U, O, N),
|
|
1506
|
+
children: `${S().t("archbase:Redefinir senha")}`
|
|
1507
1507
|
}
|
|
1508
1508
|
),
|
|
1509
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ l(
|
|
1510
1510
|
ie,
|
|
1511
1511
|
{
|
|
1512
1512
|
mt: "6px",
|
|
1513
1513
|
fullWidth: !0,
|
|
1514
|
-
color:
|
|
1514
|
+
color: h === "dark" ? k.colors.dark[4] : k.colors.gray[7],
|
|
1515
1515
|
onClick: () => {
|
|
1516
|
-
|
|
1516
|
+
W || P(!1);
|
|
1517
1517
|
},
|
|
1518
|
-
children: `${
|
|
1518
|
+
children: `${S().t("archbase:Voltar")}`
|
|
1519
1519
|
}
|
|
1520
1520
|
)
|
|
1521
|
-
] }) : /* @__PURE__ */
|
|
1522
|
-
/* @__PURE__ */
|
|
1523
|
-
|
|
1521
|
+
] }) : /* @__PURE__ */ R(te, { children: [
|
|
1522
|
+
/* @__PURE__ */ l(
|
|
1523
|
+
se,
|
|
1524
1524
|
{
|
|
1525
1525
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1526
1526
|
fw: 800,
|
|
1527
1527
|
fz: { base: "20px", md: "35px" },
|
|
1528
1528
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1529
1529
|
mt: "xs",
|
|
1530
|
-
children:
|
|
1530
|
+
children: S().t("archbase:Redefinir senha")
|
|
1531
1531
|
}
|
|
1532
1532
|
),
|
|
1533
|
-
/* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
|
|
1533
|
+
/* @__PURE__ */ l(se, { c: "dimmed", fz: 14, style: { textAlign: "justify" }, children: i }),
|
|
1534
|
+
/* @__PURE__ */ l(ye, { m: "md" }),
|
|
1535
|
+
/* @__PURE__ */ l(
|
|
1536
|
+
Ce,
|
|
1537
1537
|
{
|
|
1538
1538
|
label: "Email",
|
|
1539
|
-
placeholder: `${
|
|
1540
|
-
value:
|
|
1539
|
+
placeholder: `${S().t("archbase:usuario@email.com")}`,
|
|
1540
|
+
value: g || "",
|
|
1541
1541
|
required: !0,
|
|
1542
1542
|
onChange: (c) => {
|
|
1543
|
-
|
|
1543
|
+
E(c.currentTarget.value), L("");
|
|
1544
1544
|
},
|
|
1545
|
-
error:
|
|
1545
|
+
error: W
|
|
1546
1546
|
}
|
|
1547
1547
|
),
|
|
1548
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ l(
|
|
1549
1549
|
ie,
|
|
1550
1550
|
{
|
|
1551
|
-
disabled: !
|
|
1551
|
+
disabled: !g,
|
|
1552
1552
|
mt: "md",
|
|
1553
1553
|
fullWidth: !0,
|
|
1554
|
-
onClick: () => n(
|
|
1555
|
-
children: `${
|
|
1554
|
+
onClick: () => n(g),
|
|
1555
|
+
children: `${S().t("archbase:Enviar")}`
|
|
1556
1556
|
}
|
|
1557
1557
|
),
|
|
1558
|
-
/* @__PURE__ */
|
|
1558
|
+
/* @__PURE__ */ l(
|
|
1559
1559
|
ie,
|
|
1560
1560
|
{
|
|
1561
1561
|
mt: "6px",
|
|
1562
1562
|
fullWidth: !0,
|
|
1563
|
-
color:
|
|
1563
|
+
color: h === "dark" ? k.colors.dark[4] : k.colors.gray[7],
|
|
1564
1564
|
onClick: () => s && s(),
|
|
1565
|
-
children: `${
|
|
1565
|
+
children: `${S().t("archbase:Voltar")}`
|
|
1566
1566
|
}
|
|
1567
1567
|
)
|
|
1568
1568
|
] }),
|
|
1569
|
-
|
|
1569
|
+
C ? /* @__PURE__ */ l(se, { c: "red", style: { textAlign: "justify" }, children: C }) : null
|
|
1570
1570
|
]
|
|
1571
1571
|
}
|
|
1572
1572
|
);
|
|
1573
1573
|
}
|
|
1574
|
-
const
|
|
1575
|
-
const s =
|
|
1576
|
-
securityManager: t &&
|
|
1574
|
+
const lr = () => Ut().user, wt = "archbaseSecurityManagerStore", dr = (r, e, t, s) => r && r.existsValue(e) ? r.getValue(e) : new st(e, t, s), Br = ({ resourceName: r, resourceDescription: e, enableSecurity: t = !0 }) => {
|
|
1575
|
+
const s = Je(wt), o = lr(), [a, d] = f({
|
|
1576
|
+
securityManager: t && dr(s, r, e, o.isAdmin)
|
|
1577
1577
|
});
|
|
1578
1578
|
return z(() => {
|
|
1579
1579
|
t && s.setValue(r, a.securityManager);
|
|
1580
1580
|
}, [r]), { securityManager: a.securityManager };
|
|
1581
|
-
},
|
|
1581
|
+
}, Mr = ({
|
|
1582
1582
|
checkIntervalTokenHasExpired: r = 3e4,
|
|
1583
1583
|
// Verificar a 30 segundos
|
|
1584
1584
|
expirationThresholdOfToken: e = 300
|
|
1585
1585
|
// Antecipar em 5 minutos
|
|
1586
1586
|
}) => {
|
|
1587
|
-
const t =
|
|
1588
|
-
(n) => n.get(
|
|
1589
|
-
), s =
|
|
1590
|
-
(n) => n.get(
|
|
1591
|
-
), [o, a] =
|
|
1587
|
+
const t = ve(
|
|
1588
|
+
(n) => n.get(G.TokenManager)
|
|
1589
|
+
), s = ve(
|
|
1590
|
+
(n) => n.get(G.Authenticator)
|
|
1591
|
+
), [o, a] = f(null), [d, i] = f(!1), [u, y] = f(!0), [k, h] = f(!1), [C, A] = f(!1), [g, E] = f(""), [U, D] = f(""), [O, _] = f(null), N = Je(wt), x = {
|
|
1592
1592
|
hasContextualLogin: typeof s.loginWithContext == "function",
|
|
1593
1593
|
hasFlexibleLogin: typeof s.loginFlexible == "function",
|
|
1594
1594
|
hasSocialLogin: typeof s.loginSocial == "function",
|
|
@@ -1597,152 +1597,152 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1597
1597
|
};
|
|
1598
1598
|
z(() => {
|
|
1599
1599
|
const n = t.getUsername();
|
|
1600
|
-
if (n && n != "" &&
|
|
1600
|
+
if (n && n != "" && D(n), x.hasContextSupport && t.getContext) {
|
|
1601
1601
|
const c = t.getContext();
|
|
1602
1602
|
if (c)
|
|
1603
1603
|
try {
|
|
1604
|
-
const
|
|
1605
|
-
|
|
1606
|
-
} catch (
|
|
1607
|
-
console.warn("Erro ao carregar contexto salvo:",
|
|
1604
|
+
const m = typeof c == "string" ? JSON.parse(c) : c;
|
|
1605
|
+
_(m);
|
|
1606
|
+
} catch (m) {
|
|
1607
|
+
console.warn("Erro ao carregar contexto salvo:", m);
|
|
1608
1608
|
}
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1610
|
+
const w = t.getToken();
|
|
1611
|
+
w && (h(!0), E(""), A(!1), a(w)), y(!1);
|
|
1612
1612
|
}, []);
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1615
|
-
},
|
|
1616
|
-
i(!1),
|
|
1617
|
-
},
|
|
1613
|
+
const b = () => {
|
|
1614
|
+
A(!1), E("");
|
|
1615
|
+
}, P = (n) => {
|
|
1616
|
+
i(!1), h(!1), t.clearToken(), n && t.clearUsernameAndPassword(), x.hasContextSupport && t.clearContext && t.clearContext(), D(""), _(null), E(""), A(!1), N.clearAllValues();
|
|
1617
|
+
}, W = async (n, w, c) => {
|
|
1618
1618
|
try {
|
|
1619
|
-
i(!0),
|
|
1620
|
-
const
|
|
1621
|
-
t.saveToken(
|
|
1622
|
-
} catch (
|
|
1623
|
-
i(!1),
|
|
1619
|
+
i(!0), h(!1);
|
|
1620
|
+
const m = await s.login(n, w);
|
|
1621
|
+
t.saveToken(m), c && t.saveUsernameAndPassword(n, w), t.saveUsername(n), D(n), a(m), i(!1), h(!0);
|
|
1622
|
+
} catch (m) {
|
|
1623
|
+
i(!1), h(!1), E(ee(m)), A(!0);
|
|
1624
1624
|
}
|
|
1625
|
-
},
|
|
1626
|
-
if (!
|
|
1625
|
+
}, L = async (n, w = !1) => {
|
|
1626
|
+
if (!x.hasContextualLogin || !s.loginWithContext)
|
|
1627
1627
|
throw new Error("Login contextual não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1628
1628
|
try {
|
|
1629
|
-
i(!0),
|
|
1630
|
-
const { context: c, user:
|
|
1629
|
+
i(!0), h(!1);
|
|
1630
|
+
const { context: c, user: m, ...T } = await s.loginWithContext(n), j = {
|
|
1631
1631
|
scope: "",
|
|
1632
1632
|
ext_expires_in: T.expires_in,
|
|
1633
1633
|
...T
|
|
1634
1634
|
};
|
|
1635
|
-
t.saveToken(j),
|
|
1635
|
+
t.saveToken(j), w ? t.saveUsernameAndPassword(n.email, n.password) : t.clearUsernameAndPassword(), t.saveUsername(n.email), x.hasContextSupport && t.saveContext && c && (t.saveContext(JSON.stringify(c)), _(c)), D(n.email), a(j), i(!1), h(!0);
|
|
1636
1636
|
} catch (c) {
|
|
1637
|
-
throw i(!1),
|
|
1637
|
+
throw i(!1), h(!1), E(ee(c)), A(!0), c;
|
|
1638
1638
|
}
|
|
1639
|
-
},
|
|
1640
|
-
if (!
|
|
1639
|
+
}, B = async (n, w = !1) => {
|
|
1640
|
+
if (!x.hasFlexibleLogin || !s.loginFlexible)
|
|
1641
1641
|
throw new Error("Login flexível não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1642
1642
|
try {
|
|
1643
|
-
i(!0),
|
|
1644
|
-
const { context: c, user:
|
|
1643
|
+
i(!0), h(!1);
|
|
1644
|
+
const { context: c, user: m, ...T } = await s.loginFlexible(n), j = {
|
|
1645
1645
|
scope: "",
|
|
1646
1646
|
ext_expires_in: T.expires_in,
|
|
1647
1647
|
...T
|
|
1648
1648
|
};
|
|
1649
|
-
t.saveToken(j),
|
|
1649
|
+
t.saveToken(j), w && t.saveUsernameAndPassword(n.identifier, n.password), t.saveUsername(m.email || n.identifier), x.hasContextSupport && t.saveContext && c && (t.saveContext(JSON.stringify(c)), _(c)), D(m.email || n.identifier), a(j), i(!1), h(!0);
|
|
1650
1650
|
} catch (c) {
|
|
1651
|
-
throw i(!1),
|
|
1651
|
+
throw i(!1), h(!1), E(ee(c)), A(!0), c;
|
|
1652
1652
|
}
|
|
1653
|
-
},
|
|
1654
|
-
if (!
|
|
1653
|
+
}, H = async (n) => {
|
|
1654
|
+
if (!x.hasSocialLogin || !s.loginSocial)
|
|
1655
1655
|
throw new Error("Login social não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1656
1656
|
try {
|
|
1657
|
-
i(!0),
|
|
1658
|
-
const { context:
|
|
1657
|
+
i(!0), h(!1);
|
|
1658
|
+
const { context: w, user: c, ...m } = await s.loginSocial(n), T = {
|
|
1659
1659
|
scope: "",
|
|
1660
|
-
ext_expires_in:
|
|
1661
|
-
...
|
|
1660
|
+
ext_expires_in: m.expires_in,
|
|
1661
|
+
...m
|
|
1662
1662
|
};
|
|
1663
|
-
t.saveToken(T), t.saveUsername(c.email),
|
|
1664
|
-
} catch (
|
|
1665
|
-
throw i(!1),
|
|
1663
|
+
t.saveToken(T), t.saveUsername(c.email), x.hasContextSupport && t.saveContext && w && (t.saveContext(JSON.stringify(w)), _(w)), D(c.email), a(T), i(!1), h(!0);
|
|
1664
|
+
} catch (w) {
|
|
1665
|
+
throw i(!1), h(!1), E(ee(w)), A(!0), w;
|
|
1666
1666
|
}
|
|
1667
1667
|
}, Y = async (n) => {
|
|
1668
|
-
if (!
|
|
1668
|
+
if (!x.hasRegistration || !s.register)
|
|
1669
1669
|
throw new Error("Registro não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1670
1670
|
try {
|
|
1671
1671
|
i(!0);
|
|
1672
|
-
const
|
|
1673
|
-
return i(!1),
|
|
1674
|
-
} catch (
|
|
1675
|
-
throw i(!1),
|
|
1672
|
+
const w = await s.register(n);
|
|
1673
|
+
return i(!1), w;
|
|
1674
|
+
} catch (w) {
|
|
1675
|
+
throw i(!1), E(ee(w)), A(!0), w;
|
|
1676
1676
|
}
|
|
1677
1677
|
}, $ = async () => s.getSupportedContexts ? await s.getSupportedContexts() : { supportedContexts: ["DEFAULT"], defaultContext: "DEFAULT" }, X = async (n) => s.validateContext ? await s.validateContext(n) : { context: n, supported: n === "DEFAULT" };
|
|
1678
1678
|
z(() => {
|
|
1679
1679
|
const n = setInterval(() => {
|
|
1680
|
-
o && o.access_token && t.isTokenExpired(o, e) &&
|
|
1680
|
+
o && o.access_token && t.isTokenExpired(o, e) && p();
|
|
1681
1681
|
}, r);
|
|
1682
1682
|
return () => {
|
|
1683
1683
|
clearInterval(n);
|
|
1684
1684
|
};
|
|
1685
1685
|
}, [o]);
|
|
1686
|
-
const
|
|
1686
|
+
const p = async () => {
|
|
1687
1687
|
if (o)
|
|
1688
1688
|
try {
|
|
1689
1689
|
const n = await s.refreshToken(o?.refresh_token);
|
|
1690
1690
|
t.saveToken(n), a(n);
|
|
1691
1691
|
} catch (n) {
|
|
1692
|
-
console.error("Erro ao renovar o token:", n),
|
|
1692
|
+
console.error("Erro ao renovar o token:", n), P();
|
|
1693
1693
|
}
|
|
1694
1694
|
};
|
|
1695
1695
|
return {
|
|
1696
1696
|
// Métodos básicos (compatibilidade)
|
|
1697
|
-
login:
|
|
1698
|
-
logout:
|
|
1699
|
-
username:
|
|
1700
|
-
isAuthenticated:
|
|
1697
|
+
login: W,
|
|
1698
|
+
logout: P,
|
|
1699
|
+
username: U,
|
|
1700
|
+
isAuthenticated: k,
|
|
1701
1701
|
isAuthenticating: d,
|
|
1702
|
-
isInitializing:
|
|
1703
|
-
isError:
|
|
1704
|
-
error:
|
|
1705
|
-
clearError:
|
|
1702
|
+
isInitializing: u,
|
|
1703
|
+
isError: C,
|
|
1704
|
+
error: g,
|
|
1705
|
+
clearError: b,
|
|
1706
1706
|
accessToken: o ? o.access_token : null,
|
|
1707
1707
|
// Métodos opcionais para autenticação avançada
|
|
1708
|
-
loginWithContext:
|
|
1709
|
-
loginFlexible:
|
|
1710
|
-
loginSocial:
|
|
1711
|
-
register:
|
|
1708
|
+
loginWithContext: x.hasContextualLogin ? L : void 0,
|
|
1709
|
+
loginFlexible: x.hasFlexibleLogin ? B : void 0,
|
|
1710
|
+
loginSocial: x.hasSocialLogin ? H : void 0,
|
|
1711
|
+
register: x.hasRegistration ? Y : void 0,
|
|
1712
1712
|
getSupportedContexts: $,
|
|
1713
1713
|
validateContext: X,
|
|
1714
1714
|
// Informações de contexto
|
|
1715
|
-
context:
|
|
1715
|
+
context: O,
|
|
1716
1716
|
// Detecção de capacidades
|
|
1717
|
-
capabilities:
|
|
1717
|
+
capabilities: x
|
|
1718
1718
|
};
|
|
1719
|
-
},
|
|
1720
|
-
const r =
|
|
1721
|
-
(s) => s.get(
|
|
1722
|
-
), [e, t] =
|
|
1719
|
+
}, Or = () => {
|
|
1720
|
+
const r = ve(
|
|
1721
|
+
(s) => s.get(G.TokenManager)
|
|
1722
|
+
), [e, t] = f(null);
|
|
1723
1723
|
return z(() => {
|
|
1724
1724
|
const s = r.getToken();
|
|
1725
1725
|
s && t(s.access_token);
|
|
1726
1726
|
}, []), {
|
|
1727
1727
|
token: e
|
|
1728
1728
|
};
|
|
1729
|
-
},
|
|
1730
|
-
const r =
|
|
1731
|
-
(
|
|
1732
|
-
), [e, t] =
|
|
1729
|
+
}, Lr = () => {
|
|
1730
|
+
const r = ve(
|
|
1731
|
+
(u) => u.get(G.Authenticator)
|
|
1732
|
+
), [e, t] = f(!1), [s, o] = f("");
|
|
1733
1733
|
return {
|
|
1734
|
-
sendResetPasswordEmail: async (
|
|
1734
|
+
sendResetPasswordEmail: async (u) => {
|
|
1735
1735
|
try {
|
|
1736
|
-
return await r.sendResetPasswordEmail(
|
|
1737
|
-
} catch (
|
|
1738
|
-
throw o(ee(
|
|
1736
|
+
return await r.sendResetPasswordEmail(u);
|
|
1737
|
+
} catch (y) {
|
|
1738
|
+
throw o(ee(y)), t(!0), y;
|
|
1739
1739
|
}
|
|
1740
1740
|
},
|
|
1741
|
-
resetPassword: async (
|
|
1741
|
+
resetPassword: async (u, y, k) => {
|
|
1742
1742
|
try {
|
|
1743
|
-
return await r.resetPassword(
|
|
1744
|
-
} catch (
|
|
1745
|
-
throw o(ee(
|
|
1743
|
+
return await r.resetPassword(u, y, k);
|
|
1744
|
+
} catch (h) {
|
|
1745
|
+
throw o(ee(h)), t(!0), h;
|
|
1746
1746
|
}
|
|
1747
1747
|
},
|
|
1748
1748
|
isError: e,
|
|
@@ -1751,98 +1751,110 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1751
1751
|
t(!1), o("");
|
|
1752
1752
|
}
|
|
1753
1753
|
};
|
|
1754
|
-
},
|
|
1754
|
+
}, ur = () => /* @__PURE__ */ l($t, { p: "xl", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ R(jt, { gap: "md", children: [
|
|
1755
|
+
/* @__PURE__ */ R(we, { gap: "sm", children: [
|
|
1756
|
+
/* @__PURE__ */ l(qe, { size: "sm" }),
|
|
1757
|
+
/* @__PURE__ */ l(se, { size: "sm", c: "dimmed", children: "Carregando permissões..." })
|
|
1758
|
+
] }),
|
|
1759
|
+
/* @__PURE__ */ l(fe, { height: 40, radius: "sm" }),
|
|
1760
|
+
/* @__PURE__ */ l(fe, { height: 200, radius: "sm" }),
|
|
1761
|
+
/* @__PURE__ */ R(we, { gap: "md", children: [
|
|
1762
|
+
/* @__PURE__ */ l(fe, { height: 36, width: 100, radius: "sm" }),
|
|
1763
|
+
/* @__PURE__ */ l(fe, { height: 36, width: 100, radius: "sm" })
|
|
1764
|
+
] })
|
|
1765
|
+
] }) }), $e = Re(null), $r = ({
|
|
1755
1766
|
children: r,
|
|
1756
1767
|
user: e,
|
|
1757
1768
|
onError: t
|
|
1758
1769
|
}) => {
|
|
1759
|
-
const [s, o] =
|
|
1760
|
-
d(
|
|
1761
|
-
}, [t]),
|
|
1770
|
+
const [s, o] = f(!1), [a, d] = f(null), [i] = f([]), u = e?.isAdministrator || !1, y = pe((g) => u ? !0 : i.includes(g), [i, u]), k = pe((g) => u ? !0 : g.some((E) => i.includes(E)), [i, u]), h = pe((g) => u ? !0 : g.every((E) => i.includes(E)), [i, u]), C = pe((g) => {
|
|
1771
|
+
d(g), g && t && t(g);
|
|
1772
|
+
}, [t]), A = {
|
|
1762
1773
|
user: e,
|
|
1763
1774
|
isLoading: s,
|
|
1764
|
-
hasGlobalPermission:
|
|
1765
|
-
hasAnyGlobalPermission:
|
|
1766
|
-
hasAllGlobalPermissions:
|
|
1767
|
-
isAdmin:
|
|
1775
|
+
hasGlobalPermission: y,
|
|
1776
|
+
hasAnyGlobalPermission: k,
|
|
1777
|
+
hasAllGlobalPermissions: h,
|
|
1778
|
+
isAdmin: u,
|
|
1768
1779
|
error: a,
|
|
1769
|
-
setError:
|
|
1780
|
+
setError: C
|
|
1770
1781
|
};
|
|
1771
|
-
return /* @__PURE__ */
|
|
1772
|
-
},
|
|
1782
|
+
return /* @__PURE__ */ l($e.Provider, { value: A, children: r });
|
|
1783
|
+
}, vt = Re(null), hr = ({
|
|
1773
1784
|
children: r,
|
|
1774
1785
|
resourceName: e,
|
|
1775
1786
|
resourceDescription: t,
|
|
1776
1787
|
requiredPermissions: s = [],
|
|
1777
1788
|
fallbackComponent: o,
|
|
1778
|
-
|
|
1779
|
-
|
|
1789
|
+
loadingComponent: a,
|
|
1790
|
+
onSecurityReady: d,
|
|
1791
|
+
onError: i
|
|
1780
1792
|
}) => {
|
|
1781
|
-
const
|
|
1782
|
-
if (!
|
|
1793
|
+
const u = Ne($e);
|
|
1794
|
+
if (!u)
|
|
1783
1795
|
throw new Error("ArchbaseViewSecurityProvider deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
1784
|
-
const { user:
|
|
1785
|
-
if (
|
|
1786
|
-
if (!
|
|
1787
|
-
|
|
1796
|
+
const { user: y, isAdmin: k } = u, [h, C] = f(null), [A, g] = f(!0), [E, U] = f(null);
|
|
1797
|
+
if (Ge.useEffect(() => {
|
|
1798
|
+
if (!y) {
|
|
1799
|
+
g(!1);
|
|
1788
1800
|
return;
|
|
1789
1801
|
}
|
|
1790
|
-
const
|
|
1802
|
+
const b = new st(e, t, k);
|
|
1791
1803
|
(async () => {
|
|
1792
|
-
|
|
1804
|
+
g(!0);
|
|
1793
1805
|
try {
|
|
1794
|
-
await
|
|
1795
|
-
|
|
1806
|
+
await b.apply(() => {
|
|
1807
|
+
C(b), g(!1), d && d(b);
|
|
1796
1808
|
});
|
|
1797
1809
|
} catch {
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1810
|
+
const L = b.getError() || "Erro ao carregar permissões";
|
|
1811
|
+
U(L), g(!1), i && i(L);
|
|
1800
1812
|
}
|
|
1801
1813
|
})();
|
|
1802
|
-
}, [e, t,
|
|
1803
|
-
return /* @__PURE__ */
|
|
1804
|
-
if (
|
|
1805
|
-
return /* @__PURE__ */
|
|
1814
|
+
}, [e, t, y, k, d, i]), A)
|
|
1815
|
+
return a ? /* @__PURE__ */ l(te, { children: a }) : /* @__PURE__ */ l(ur, {});
|
|
1816
|
+
if (E)
|
|
1817
|
+
return /* @__PURE__ */ l("div", { className: "archbase-security-error", children: /* @__PURE__ */ R("div", { children: [
|
|
1806
1818
|
"Erro ao carregar permissões: ",
|
|
1807
|
-
|
|
1819
|
+
E
|
|
1808
1820
|
] }) });
|
|
1809
|
-
if (!
|
|
1810
|
-
return o || /* @__PURE__ */
|
|
1811
|
-
if (s.length > 0 &&
|
|
1812
|
-
(
|
|
1821
|
+
if (!y)
|
|
1822
|
+
return o || /* @__PURE__ */ l("div", { className: "archbase-security-no-user", children: /* @__PURE__ */ l("div", { children: "É necessário fazer login para acessar esta área" }) });
|
|
1823
|
+
if (s.length > 0 && h && !s.every(
|
|
1824
|
+
(P) => h.hasPermission(P)
|
|
1813
1825
|
))
|
|
1814
|
-
return o || /* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1826
|
+
return o || /* @__PURE__ */ R("div", { className: "archbase-security-access-denied", children: [
|
|
1827
|
+
/* @__PURE__ */ l("div", { children: "Você não possui permissão para acessar esta área" }),
|
|
1828
|
+
/* @__PURE__ */ R("small", { children: [
|
|
1817
1829
|
"Permissões necessárias: ",
|
|
1818
1830
|
s.join(", ")
|
|
1819
1831
|
] })
|
|
1820
1832
|
] });
|
|
1821
|
-
const
|
|
1822
|
-
securityManager:
|
|
1823
|
-
hasPermission: (
|
|
1824
|
-
hasAnyPermission: (
|
|
1825
|
-
hasAllPermissions: (
|
|
1826
|
-
registerAction: (
|
|
1827
|
-
|
|
1833
|
+
const x = {
|
|
1834
|
+
securityManager: h,
|
|
1835
|
+
hasPermission: (b) => h?.hasPermission(b) || !1,
|
|
1836
|
+
hasAnyPermission: (b) => b.some((P) => h?.hasPermission(P) || !1),
|
|
1837
|
+
hasAllPermissions: (b) => b.every((P) => h?.hasPermission(P) || !1),
|
|
1838
|
+
registerAction: (b, P) => {
|
|
1839
|
+
h?.registerAction(b, P);
|
|
1828
1840
|
},
|
|
1829
|
-
isLoading:
|
|
1830
|
-
error:
|
|
1841
|
+
isLoading: A,
|
|
1842
|
+
error: E
|
|
1831
1843
|
};
|
|
1832
|
-
return /* @__PURE__ */
|
|
1833
|
-
},
|
|
1834
|
-
const r =
|
|
1844
|
+
return /* @__PURE__ */ l(vt.Provider, { value: x, children: r });
|
|
1845
|
+
}, pr = () => {
|
|
1846
|
+
const r = Ne($e);
|
|
1835
1847
|
if (!r)
|
|
1836
1848
|
throw new Error("useArchbaseSecurity deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
1837
1849
|
return r;
|
|
1838
|
-
},
|
|
1839
|
-
const r =
|
|
1850
|
+
}, je = () => {
|
|
1851
|
+
const r = Ne(vt);
|
|
1840
1852
|
if (!r)
|
|
1841
1853
|
throw new Error("useArchbaseViewSecurity deve ser usado dentro de um ArchbaseViewSecurityProvider");
|
|
1842
1854
|
return r;
|
|
1843
|
-
},
|
|
1844
|
-
const t =
|
|
1845
|
-
return
|
|
1855
|
+
}, jr = (r, e) => {
|
|
1856
|
+
const t = je(), { hasPermission: s, hasAnyPermission: o, hasAllPermissions: a, registerAction: d, securityManager: i, isLoading: u, error: y } = t;
|
|
1857
|
+
return Ge.useEffect(() => {
|
|
1846
1858
|
r && e && (d("create", `Criar ${e}`), d("edit", `Editar ${e}`), d("delete", `Deletar ${e}`), d("view", `Visualizar ${e}`), d("list", `Listar ${e}`));
|
|
1847
1859
|
}, [r, e, d]), {
|
|
1848
1860
|
hasPermission: s,
|
|
@@ -1855,18 +1867,18 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1855
1867
|
canDelete: s("delete"),
|
|
1856
1868
|
canView: s("view"),
|
|
1857
1869
|
canList: s("list"),
|
|
1858
|
-
isLoading:
|
|
1859
|
-
error:
|
|
1870
|
+
isLoading: u,
|
|
1871
|
+
error: y
|
|
1860
1872
|
};
|
|
1861
|
-
},
|
|
1862
|
-
const r =
|
|
1873
|
+
}, Fr = () => {
|
|
1874
|
+
const r = je();
|
|
1863
1875
|
return {
|
|
1864
1876
|
check: r.hasPermission,
|
|
1865
1877
|
checkAny: r.hasAnyPermission,
|
|
1866
1878
|
checkAll: r.hasAllPermissions,
|
|
1867
|
-
isAdmin:
|
|
1879
|
+
isAdmin: pr().isAdmin
|
|
1868
1880
|
};
|
|
1869
|
-
},
|
|
1881
|
+
}, bt = ({
|
|
1870
1882
|
children: r,
|
|
1871
1883
|
actionName: e,
|
|
1872
1884
|
requiredPermissions: t = [],
|
|
@@ -1875,13 +1887,13 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1875
1887
|
fallback: a = null,
|
|
1876
1888
|
autoRegister: d = !0
|
|
1877
1889
|
}) => {
|
|
1878
|
-
const { hasPermission: i, hasAnyPermission:
|
|
1890
|
+
const { hasPermission: i, hasAnyPermission: u, hasAllPermissions: y, registerAction: k } = je();
|
|
1879
1891
|
z(() => {
|
|
1880
|
-
d && e && o &&
|
|
1881
|
-
}, [e, o, d,
|
|
1882
|
-
let
|
|
1883
|
-
return e ?
|
|
1884
|
-
},
|
|
1892
|
+
d && e && o && k(e, o);
|
|
1893
|
+
}, [e, o, d, k]);
|
|
1894
|
+
let h = !1;
|
|
1895
|
+
return e ? h = i(e) : t.length > 0 ? h = s ? y(t) : u(t) : h = !0, h ? /* @__PURE__ */ l(te, { children: r }) : /* @__PURE__ */ l(te, { children: a });
|
|
1896
|
+
}, Vr = ({
|
|
1885
1897
|
actionName: r,
|
|
1886
1898
|
actionDescription: e,
|
|
1887
1899
|
children: t,
|
|
@@ -1890,18 +1902,18 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1890
1902
|
className: a = "",
|
|
1891
1903
|
style: d = {},
|
|
1892
1904
|
variant: i = "primary",
|
|
1893
|
-
size:
|
|
1894
|
-
type:
|
|
1905
|
+
size: u = "medium",
|
|
1906
|
+
type: y = "button"
|
|
1895
1907
|
}) => {
|
|
1896
|
-
const
|
|
1897
|
-
const
|
|
1898
|
-
return `${
|
|
1899
|
-
},
|
|
1900
|
-
const
|
|
1908
|
+
const k = () => {
|
|
1909
|
+
const C = "archbase-secure-btn", A = `archbase-secure-btn--${i}`, g = `archbase-secure-btn--${u}`;
|
|
1910
|
+
return `${C} ${A} ${g} ${a}`.trim();
|
|
1911
|
+
}, h = () => {
|
|
1912
|
+
const C = {
|
|
1901
1913
|
small: { padding: "4px 8px", fontSize: "12px" },
|
|
1902
1914
|
medium: { padding: "8px 16px", fontSize: "14px" },
|
|
1903
1915
|
large: { padding: "12px 24px", fontSize: "16px" }
|
|
1904
|
-
},
|
|
1916
|
+
}, A = {
|
|
1905
1917
|
primary: { backgroundColor: "#007bff", color: "white" },
|
|
1906
1918
|
secondary: { backgroundColor: "#6c757d", color: "white" },
|
|
1907
1919
|
danger: { backgroundColor: "#dc3545", color: "white" },
|
|
@@ -1914,31 +1926,31 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1914
1926
|
cursor: o ? "not-allowed" : "pointer",
|
|
1915
1927
|
fontWeight: "500",
|
|
1916
1928
|
opacity: o ? 0.6 : 1,
|
|
1917
|
-
...
|
|
1918
|
-
...
|
|
1929
|
+
...C[u],
|
|
1930
|
+
...A[i],
|
|
1919
1931
|
...d
|
|
1920
1932
|
};
|
|
1921
1933
|
};
|
|
1922
|
-
return /* @__PURE__ */
|
|
1923
|
-
|
|
1934
|
+
return /* @__PURE__ */ l(
|
|
1935
|
+
bt,
|
|
1924
1936
|
{
|
|
1925
1937
|
actionName: r,
|
|
1926
1938
|
actionDescription: e,
|
|
1927
1939
|
fallback: null,
|
|
1928
|
-
children: /* @__PURE__ */
|
|
1940
|
+
children: /* @__PURE__ */ l(
|
|
1929
1941
|
"button",
|
|
1930
1942
|
{
|
|
1931
|
-
type:
|
|
1943
|
+
type: y,
|
|
1932
1944
|
onClick: s,
|
|
1933
1945
|
disabled: o,
|
|
1934
|
-
className:
|
|
1935
|
-
style:
|
|
1946
|
+
className: k(),
|
|
1947
|
+
style: h(),
|
|
1936
1948
|
children: t
|
|
1937
1949
|
}
|
|
1938
1950
|
)
|
|
1939
1951
|
}
|
|
1940
1952
|
);
|
|
1941
|
-
},
|
|
1953
|
+
}, zr = ({
|
|
1942
1954
|
children: r,
|
|
1943
1955
|
actionName: e,
|
|
1944
1956
|
actionDescription: t,
|
|
@@ -1946,12 +1958,12 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1946
1958
|
label: o,
|
|
1947
1959
|
fallbackText: a = "Campo não disponível",
|
|
1948
1960
|
fallbackComponent: d
|
|
1949
|
-
}) => e ? /* @__PURE__ */
|
|
1950
|
-
|
|
1961
|
+
}) => e ? /* @__PURE__ */ l(
|
|
1962
|
+
bt,
|
|
1951
1963
|
{
|
|
1952
1964
|
actionName: e,
|
|
1953
1965
|
actionDescription: t,
|
|
1954
|
-
fallback: d || /* @__PURE__ */
|
|
1966
|
+
fallback: d || /* @__PURE__ */ R("div", { className: "archbase-secure-field-fallback", style: {
|
|
1955
1967
|
padding: "8px",
|
|
1956
1968
|
color: "#666",
|
|
1957
1969
|
fontStyle: "italic",
|
|
@@ -1959,7 +1971,7 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1959
1971
|
border: "1px dashed #dee2e6",
|
|
1960
1972
|
borderRadius: "4px"
|
|
1961
1973
|
}, children: [
|
|
1962
|
-
s && o && /* @__PURE__ */
|
|
1974
|
+
s && o && /* @__PURE__ */ R("label", { style: { fontWeight: "bold" }, children: [
|
|
1963
1975
|
o,
|
|
1964
1976
|
": "
|
|
1965
1977
|
] }),
|
|
@@ -1967,90 +1979,91 @@ const ir = () => Tt().user, gt = "archbaseSecurityManagerStore", ar = (r, e, t,
|
|
|
1967
1979
|
] }),
|
|
1968
1980
|
children: r
|
|
1969
1981
|
}
|
|
1970
|
-
) : /* @__PURE__ */
|
|
1971
|
-
function
|
|
1982
|
+
) : /* @__PURE__ */ l(te, { children: r });
|
|
1983
|
+
function Wr(r, e) {
|
|
1972
1984
|
return function(s) {
|
|
1973
1985
|
const { resourceName: o, resourceDescription: a, requiredPermissions: d, fallbackComponent: i } = e;
|
|
1974
|
-
return /* @__PURE__ */
|
|
1975
|
-
|
|
1986
|
+
return /* @__PURE__ */ l(
|
|
1987
|
+
hr,
|
|
1976
1988
|
{
|
|
1977
1989
|
resourceName: o,
|
|
1978
1990
|
resourceDescription: a,
|
|
1979
1991
|
requiredPermissions: d,
|
|
1980
1992
|
fallbackComponent: i,
|
|
1981
|
-
children: /* @__PURE__ */
|
|
1993
|
+
children: /* @__PURE__ */ l(r, { ...s })
|
|
1982
1994
|
}
|
|
1983
1995
|
);
|
|
1984
1996
|
};
|
|
1985
1997
|
}
|
|
1986
1998
|
export {
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
1999
|
+
wt as ARCHBASE_SECURITY_MANAGER_STORE,
|
|
2000
|
+
ir as AccessIntervalDto,
|
|
2001
|
+
it as AccessScheduleDto,
|
|
2002
|
+
Le as AccessTokenDto,
|
|
2003
|
+
ar as ActionDto,
|
|
2004
|
+
Oe as ApiTokenDto,
|
|
2005
|
+
gt as ArchbaseAccessTokenService,
|
|
2006
|
+
mt as ArchbaseApiTokenService,
|
|
2007
|
+
sr as ArchbaseAuthContext,
|
|
2008
|
+
Ur as ArchbaseAuthProvider,
|
|
2009
|
+
pt as ArchbaseGroupService,
|
|
2010
|
+
Rr as ArchbaseLogin,
|
|
2011
|
+
ft as ArchbaseProfileService,
|
|
2012
|
+
bt as ArchbaseProtectedComponent,
|
|
2013
|
+
Nr as ArchbaseResetPassword,
|
|
2014
|
+
yt as ArchbaseResourceService,
|
|
2015
|
+
Vr as ArchbaseSecureActionButton,
|
|
2016
|
+
zr as ArchbaseSecureFormField,
|
|
2017
|
+
st as ArchbaseSecurityManager,
|
|
2018
|
+
$r as ArchbaseSecurityProvider,
|
|
2007
2019
|
V as ArchbaseTenantManager,
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2020
|
+
Xe as ArchbaseUser,
|
|
2021
|
+
ht as ArchbaseUserService,
|
|
2022
|
+
Qe as ArchbaseUsernameAndPassword,
|
|
2023
|
+
Qe as ArchbaseUsernameAndPasswordImpl,
|
|
2024
|
+
hr as ArchbaseViewSecurityProvider,
|
|
2025
|
+
Te as CONTEXT_STORAGE_KEY,
|
|
2026
|
+
Vt as DefaultArchbaseTokenManager,
|
|
2027
|
+
ur as DefaultSecurityLoading,
|
|
2015
2028
|
Q as ENCRYPTION_KEY,
|
|
2016
|
-
|
|
2029
|
+
et as FetchError,
|
|
2017
2030
|
he as GroupDto,
|
|
2018
|
-
|
|
2031
|
+
_r as PermissionDto,
|
|
2019
2032
|
ue as ProfileDto,
|
|
2020
|
-
|
|
2033
|
+
dt as ResourceDto,
|
|
2021
2034
|
le as SecurityDto,
|
|
2022
2035
|
ae as SecurityType,
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2036
|
+
ke as TOKEN_COOKIE_NAME,
|
|
2037
|
+
nr as TipoRecurso,
|
|
2038
|
+
Pe as USER_NAME,
|
|
2039
|
+
Ie as USER_NAME_AND_PASSWORD,
|
|
2040
|
+
Ee as UserDto,
|
|
2041
|
+
Be as UserGroupDto,
|
|
2042
|
+
Zt as createInternalConfig,
|
|
2043
|
+
ge as decodeJWT,
|
|
2044
|
+
oe as epochAtSecondsFromNow,
|
|
2045
|
+
He as epochTimeIsPast,
|
|
2046
|
+
qt as fetchTokens,
|
|
2047
|
+
Yt as fetchWithRefreshToken,
|
|
2048
|
+
Wt as generateCodeChallenge,
|
|
2049
|
+
zt as generateRandomString,
|
|
2050
|
+
Ze as getRandomInteger,
|
|
2051
|
+
rr as getRefreshExpiresIn,
|
|
2052
|
+
Gt as postWithXForm,
|
|
2053
|
+
Jt as redirectToLogin,
|
|
2054
|
+
Xt as redirectToLogout,
|
|
2055
|
+
Mr as useArchbaseAuthenticationManager,
|
|
2056
|
+
Or as useArchbaseGetCurrentToken,
|
|
2057
|
+
lr as useArchbaseGetLoggedUser,
|
|
2058
|
+
Fr as useArchbasePermissionCheck,
|
|
2059
|
+
Lr as useArchbaseResetPassword,
|
|
2060
|
+
jr as useArchbaseSecureForm,
|
|
2061
|
+
pr as useArchbaseSecurity,
|
|
2062
|
+
Br as useArchbaseSecurityManager,
|
|
2063
|
+
Dr as useArchbaseTenantManager,
|
|
2064
|
+
je as useArchbaseViewSecurity,
|
|
2065
|
+
Cr as useBrowserStorage,
|
|
2066
|
+
er as validateConfig,
|
|
2067
|
+
Qt as validateState,
|
|
2068
|
+
Wr as withArchbaseSecurity
|
|
2056
2069
|
};
|