odant-work 1.0.105 → 1.0.107
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/$server/$folder/$class/$structure/$user/handlers/pages/form/calendar/$handler/class.js +12 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/email/$handler/class.js +12 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/folder/$handler/class.js +12 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/search/$handler/class.js +12 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/class.js +14 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +5 -4
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/skills/$handler/class.js +5 -4
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/tokens/$handler/class.js +8 -2
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +73 -22
- package/$server/$folder/handlers/pages/form/$handler/class.js +255 -100
- package/$server/$folder/lib/consultant/consultant.js +123 -66
- package/$server/$folder/lib/explorer/explorer.js +19 -22
- package/$server/$folder/lib/icon/icon.js +4 -1
- package/$server/$folder/lib/prompt-bar/prompt-bar.js +24 -1
- package/$server/$folder/lib/tree/tree.js +5 -5
- package/MODULES/$domain/class.js +1 -0
- package/package.json +1 -1
- package/sources/client.js +30 -2
- package/sources/host/auth-methods.js +25 -14
- package/sources/host/http-server.js +1 -0
- package/sources/host/websocket.js +11 -8
- package/sources/modules/call/call.js +5 -1
- package/sources/modules/user-profile/user-profile.js +9 -1
- package/sources/server/access/gateway.js +3 -7
- package/sources/server/chat-threads.js +32 -3
- package/sources/server/class/feed.js +25 -13
- package/sources/server/class/security.js +97 -31
- package/sources/server/logs.js +17 -10
- package/sources/server/server.js +17 -6
- package/sources/server/user.js +20 -5
package/sources/server/user.js
CHANGED
|
@@ -25,7 +25,11 @@ export class $user extends $class {
|
|
|
25
25
|
get $public() {
|
|
26
26
|
return {
|
|
27
27
|
get online() {
|
|
28
|
-
|
|
28
|
+
if (!this._ownUserEnabledSync())
|
|
29
|
+
return false;
|
|
30
|
+
return Object.values(globalThis.$server?.sessions || {}).some(
|
|
31
|
+
s => s?.uid === this.id && Object.keys(s.sockets || {}).length > 0
|
|
32
|
+
);
|
|
29
33
|
},
|
|
30
34
|
get enabled() {
|
|
31
35
|
return this._ownUserEnabledSync();
|
|
@@ -33,6 +37,9 @@ export class $user extends $class {
|
|
|
33
37
|
get usersContainer() {
|
|
34
38
|
return this.DATA?.usersContainer === true ? true : undefined;
|
|
35
39
|
},
|
|
40
|
+
get isUser() {
|
|
41
|
+
return this.DATA?.usersContainer === true ? undefined : true;
|
|
42
|
+
},
|
|
36
43
|
icon: {
|
|
37
44
|
get() {
|
|
38
45
|
let icon = this.DATA?.icon;
|
|
@@ -150,13 +157,21 @@ export class $user extends $class {
|
|
|
150
157
|
await this.init;
|
|
151
158
|
if (this.DATA?.usersContainer === true)
|
|
152
159
|
return super.allowAccess(params);
|
|
153
|
-
|
|
154
|
-
if (DEV_MODE)
|
|
160
|
+
if (DEV_MODE || !params?.session || params.session.$user === globalThis.WORK)
|
|
155
161
|
return true;
|
|
156
|
-
// профили пользователей
|
|
162
|
+
// профили пользователей закрыты для узлов сети и анонимных запросов
|
|
157
163
|
if (params?.session?.principal?.kind === 'node')
|
|
158
164
|
return false;
|
|
159
|
-
|
|
165
|
+
const uid = this.constructor.resolveUid(params);
|
|
166
|
+
if (!uid)
|
|
167
|
+
return false;
|
|
168
|
+
if (this.id === uid)
|
|
169
|
+
return true;
|
|
170
|
+
if (globalThis.WORK && await this._isWorkBoss(params))
|
|
171
|
+
return true;
|
|
172
|
+
const { visibleContacts } = await import('./chat-threads.js');
|
|
173
|
+
const contacts = await visibleContacts(this, params);
|
|
174
|
+
return contacts.some(c => c.id === this.id);
|
|
160
175
|
}
|
|
161
176
|
}
|
|
162
177
|
$user.type_chain = Object.create(null);
|