@communecter/cocolight-api-client 1.0.19 → 1.0.21

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/src/api/User.js CHANGED
@@ -1,15 +1,9 @@
1
1
  import { ApiError, ApiResponseError } from "../error.js";
2
- import { DraftStateMixin } from "../mixin/DraftStateMixin.js";
3
- import { MutualEntityMixin } from "../mixin/MutualEntityMixin.js";
2
+ import BaseEntity from "./BaseEntity.js";
4
3
  import { UserMixin } from "../mixin/UserMixin.js";
5
- import { UtilMixin } from "../mixin/UtilMixin.js";
6
4
 
7
5
  // User.js
8
- export class User {
9
- _draftData = {};
10
- _initialDraftData = {};
11
- _serverData = null;
12
- _calledFromSave = false;
6
+ export class User extends BaseEntity {
13
7
 
14
8
  static entityType = "citoyens";
15
9
 
@@ -31,6 +25,26 @@ export class User {
31
25
  ["PROFIL_IMAGE", "updateImageProfil"]
32
26
  ]);
33
27
 
28
+ defaultFields = {
29
+ typeElement: this.getEntityType(),
30
+ };
31
+
32
+ removeFields = [
33
+ "typeElement",
34
+ ];
35
+
36
+ transforms = {
37
+ github: (val, full) => full?.socialNetwork?.github,
38
+ gitlab: (val, full) => full?.socialNetwork?.gitlab,
39
+ facebook: (val, full) => full?.socialNetwork?.facebook,
40
+ twitter: (val, full) => full?.socialNetwork?.twitter,
41
+ instagram: (val, full) => full?.socialNetwork?.instagram,
42
+ diaspora: (val, full) => full?.socialNetwork?.diaspora,
43
+ mastodon: (val, full) => full?.socialNetwork?.mastodon,
44
+ telegram: (val, full) => full?.socialNetwork?.telegram,
45
+ signal: (val, full) => full?.socialNetwork?.signal
46
+ };
47
+
34
48
  /**
35
49
  * Crée une instance de User.
36
50
  *
@@ -51,120 +65,31 @@ export class User {
51
65
  */
52
66
 
53
67
  constructor(parent, data = {}, deps = {}) {
54
- this.__entityTag = "User";
55
-
56
68
  if(!deps.EndpointApi){
57
69
  throw new ApiError("EndpointApi class must be injected to avoid circular dependency.");
58
70
  }
59
71
  if (!data?.id && !data?.slug) {
60
72
  throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.");
61
73
  }
62
-
74
+
63
75
  if (!deps.Organization) throw new ApiError("Organization class must be injected.");
64
76
  if (!deps.Project) throw new ApiError("Project class must be injected.");
65
77
  if (!deps.Event) throw new ApiError("Event class must be injected.");
66
78
  if (!deps.Poi) throw new ApiError("Poi class must be injected.");
67
79
  if (!deps.Badge) throw new ApiError("Badge class must be injected.");
68
80
  if (!deps.News) throw new ApiError("News class must be injected.");
69
-
70
- if (parent?.__entityTag === "ApiClient") {
71
- this.apiClient = parent;
72
- this.parent = null;
73
- } else if (parent?.apiClient) {
74
- this.apiClient = parent.apiClient;
75
- this.parent = parent;
76
- } else {
77
- throw new ApiError("Parent invalide ou ApiClient manquant.");
78
- }
79
-
80
- this.deps = deps;
81
-
82
- // Gérer les deux cas : fonction constructeur ou instance
83
- if (typeof deps.EndpointApi === "function") {
84
- this.endpointApi = new deps.EndpointApi(this.apiClient);
85
- } else if (typeof deps.EndpointApi === "object") {
86
- this.endpointApi = deps.EndpointApi;
87
- } else {
88
- throw new ApiError("deps.EndpointApi doit être une classe ou une instance valide.");
89
- }
90
-
91
- this._serverData = null;
92
-
93
- const { draft, proxy } = this._buildDraftAndProxy({
94
- data: { ...data, ...this.defaultFields },
95
- serverData: this._serverData,
96
- constant: User.SCHEMA_CONSTANTS,
97
- apiClient: this.apiClient,
98
- transforms: this.transforms,
99
- removeFields: this.removeFields
100
- });
101
-
102
- this._initialDraftData = JSON.parse(JSON.stringify(draft)); // snapshot propre
103
- this._draftData = draft;
104
- this.data = proxy;
105
- }
106
-
107
- get id() {
108
- return this._draftData.id || null;
109
- }
110
-
111
- _id(newId) {
112
- this._draftData.id = newId;
81
+
82
+ super(parent, data, deps);
113
83
  }
114
84
 
115
85
  get slug() {
116
86
  return this._draftData.slug || null;
117
87
  }
118
88
 
119
- get isConnected() {
120
- return this.apiClient.isConnected;
121
- }
122
-
123
- _setData(newData) {
124
- this._serverData = { ...newData };
125
-
126
- const { draft, proxy } = this._buildDraftAndProxy({
127
- data: { ...newData, ...this.defaultFields },
128
- serverData: this._serverData,
129
- constant: User.SCHEMA_CONSTANTS,
130
- apiClient: this.apiClient,
131
- transforms: this.transforms,
132
- removeFields: this.removeFields
133
- });
134
- this._initialDraftData = JSON.parse(JSON.stringify(draft));
135
- this._draftData = draft;
136
- this.data = proxy;
137
- }
138
-
139
- getEntityType() {
140
- return User.entityType;
141
- }
142
-
143
- get userId() {
144
- return this.apiClient.userId;
145
- }
146
-
147
89
  get isMe() {
148
90
  return this.isConnected && this.userId === this.id;
149
91
  }
150
92
 
151
- get draftData() {
152
- return this._draftData;
153
- }
154
-
155
- get initialDraftData() {
156
- return this._initialDraftData;
157
- }
158
-
159
- get serverData() {
160
- return this._serverData;
161
- }
162
-
163
- async refresh() {
164
- if (!this.id) throw new ApiError("Impossible de rafraîchir sans ID.");
165
- return this.get();
166
- }
167
-
168
93
  /**
169
94
  * Récupère le profil complet de l'utilisateur.
170
95
  * Si l'utilisateur est connecté, on appelle le endpoint ME_INFO_URL,
@@ -179,7 +104,7 @@ export class User {
179
104
  this._setData(data);
180
105
  return data;
181
106
  } else {
182
- const data = await this.getPublicProfile();
107
+ const data = await this._getPublicProfile();
183
108
  this._setData(data);
184
109
  return data;
185
110
  }
@@ -210,26 +135,14 @@ export class User {
210
135
  * @throws {ApiError} - Si l'utilisateur n'est pas autorisé.
211
136
  */
212
137
  async save() {
213
-
214
138
  if(!this.isMe){
215
139
  throw new ApiError("Vous devez être connecté et être l'utilisateur pour sauvegarder.");
216
140
  }
217
- this._calledFromSave = true;
218
- try{
219
- const payload = { ...this._draftData };
220
-
221
- if (this.id) {
222
- const hasChanged = await this._update(payload);
223
- if (hasChanged) {
224
- // this._updateInitialDraftSnapshot();
225
- await this.refresh();
226
- }
227
- return this._serverData;
228
- }
229
- } finally {
230
- this._calledFromSave = false;
231
- }
232
-
141
+ await super.save();
142
+ }
143
+
144
+ async _add() {
145
+ throw new ApiError("Vous ne pouvez pas ajouter un utilisateur par ce moyen.");
233
146
  }
234
147
 
235
148
  /**
@@ -296,7 +209,10 @@ export class User {
296
209
  * @returns {Promise<void>} - Résultat de la mise à jour.
297
210
  */
298
211
  async updateSettings(data = {}) {
299
- await this.callIsMe(() => this.endpointApi.updateSettings(data));
212
+ if(!this.isMe){
213
+ throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les paramètres.");
214
+ }
215
+ await super.updateSettings(data);
300
216
  await this.refresh();
301
217
  }
302
218
 
@@ -305,7 +221,10 @@ export class User {
305
221
  * Constant : UPDATE_BLOCK_DESCRIPTION
306
222
  */
307
223
  async updateDescription(data = {}) {
308
- return this.callIsMe(() => this.endpointApi.updateBlockDescription(data));
224
+ if(!this.isMe){
225
+ throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la description.");
226
+ }
227
+ return super.updateDescription(data);
309
228
  }
310
229
 
311
230
  /**
@@ -313,7 +232,10 @@ export class User {
313
232
  * Constant : UPDATE_BLOCK_INFO
314
233
  */
315
234
  async updateInfo(data = {}) {
316
- return this.callIsMe(() => this.endpointApi.updateBlockInfo(data));
235
+ if(!this.isMe){
236
+ throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les informations.");
237
+ }
238
+ return super.updateInfo(data);
317
239
  }
318
240
 
319
241
  /**
@@ -321,7 +243,10 @@ export class User {
321
243
  * Constant : UPDATE_BLOCK_SOCIAL
322
244
  */
323
245
  async updateSocial(data = {}) {
324
- return this.callIsMe(() => this.endpointApi.updateBlockSocial(data));
246
+ if(!this.isMe){
247
+ throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les réseaux sociaux.");
248
+ }
249
+ return super.updateSocial(data);
325
250
  }
326
251
 
327
252
  /**
@@ -329,7 +254,10 @@ export class User {
329
254
  * Constant : UPDATE_BLOCK_LOCALITY
330
255
  */
331
256
  async updateLocality(data = {}) {
332
- return this.callIsMe(() => this.endpointApi.updateBlockLocality(data));
257
+ if(!this.isMe){
258
+ throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la localité.");
259
+ }
260
+ return super.updateLocality(data);
333
261
  }
334
262
 
335
263
  /**
@@ -337,15 +265,10 @@ export class User {
337
265
  * Constant : UPDATE_BLOCK_SLUG
338
266
  */
339
267
  async updateSlug({ slug }) {
340
- try {
341
- await this.endpointApi.check({ slug });
342
- } catch (error) {
343
- if(error instanceof ApiResponseError) {
344
- throw new ApiResponseError("Erreur lors de la vérification du slug.", error.status, error.data);
345
- }
346
- throw error;
268
+ if(!this.isMe){
269
+ throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour le slug.");
347
270
  }
348
- return this.callIsMe(() => this.endpointApi.updateBlockSlug({ slug }));
271
+ return super.updateSlug({ slug });
349
272
  }
350
273
 
351
274
  /**
@@ -353,8 +276,10 @@ export class User {
353
276
  * Constant : PROFIL_IMAGE
354
277
  */
355
278
  async updateImageProfil({ profil_avatar: image }) {
356
- image = await this._validateImage(image);
357
- return this.callIsMe(() => this.endpointApi.profilImage({ profil_avatar: image }));
279
+ if(!this.isMe){
280
+ throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de profil.");
281
+ }
282
+ return super.updateImageProfil({ profil_avatar: image });
358
283
  }
359
284
 
360
285
  /**
@@ -376,26 +301,24 @@ export class User {
376
301
  };
377
302
  }
378
303
 
379
- const arrayObjetOrganizations = await fetchFn();
304
+ const arrayObjet = await fetchFn();
380
305
 
381
- if (!Array.isArray(arrayObjetOrganizations.results)) {
382
- throw new ApiResponseError("Erreur lors de la récupération des organisations.", 500, arrayObjetOrganizations.results);
306
+ if (!Array.isArray(arrayObjet.results)) {
307
+ throw new ApiResponseError("Erreur lors de la récupération des organisations.", 500, arrayObjet.results);
383
308
  }
384
309
 
385
310
  // nettoyage du count
386
- delete arrayObjetOrganizations?.count?.spam;
311
+ delete arrayObjet?.count?.spam;
387
312
 
388
313
  // calcul du total
389
- const totalCount = Object.values(arrayObjetOrganizations.count || {}).reduce((acc, val) => acc + val, 0);
390
- arrayObjetOrganizations.count.total = totalCount;
314
+ const totalCount = Object.values(arrayObjet.count || {}).reduce((acc, val) => acc + val, 0);
315
+ arrayObjet.count.total = totalCount;
391
316
 
392
- const rawOrganizationsList = arrayObjetOrganizations.results.map(
393
- (d) => this.linkEntity?.(d.collection, d) ?? d
394
- );
317
+ const rawList = this._linkEntities(arrayObjet.results);
395
318
 
396
319
  return {
397
- count: arrayObjetOrganizations.count,
398
- results: rawOrganizationsList
320
+ count: arrayObjet.count,
321
+ results: rawList
399
322
  };
400
323
  }
401
324
 
@@ -404,37 +327,7 @@ export class User {
404
327
  * Constant : GET_PROJECTS_ADMIN | GET_PROJECTS_NO_ADMIN
405
328
  */
406
329
  async getProjects(data = {}) {
407
- delete data?.pathParams;
408
-
409
- const fetchFn = this.isMe
410
- ? () => this.callIsMe(() => this.endpointApi.getProjectsAdmin(data))
411
- : () => this.endpointApi.getProjectsNoAdmin(data);
412
-
413
- if (!this.isMe && !data.filters) {
414
- data.filters = {
415
- "$or": {
416
- [`links.contributors.${this.id}`]: { "$exists": true },
417
- [`parent.${this.id}`]: { "$exists": true }
418
- },
419
- [`links.contributors.${this.id}`]: { "$exists": true }
420
- // TODO : revoir les filtres pour harmoniser avec orga (schema pris de cocolight)
421
- };
422
- }
423
-
424
- const arrayObjetProjects = await fetchFn();
425
-
426
- if (!Array.isArray(arrayObjetProjects.results)) {
427
- throw new ApiResponseError("Erreur lors de la récupération des projets.", 500, arrayObjetProjects.results);
428
- }
429
-
430
- const rawProjectsList = arrayObjetProjects.results.map(
431
- (d) => this.linkEntity?.(d.collection, d) ?? d
432
- );
433
-
434
- return {
435
- count: arrayObjetProjects?.count?.projects ?? 0,
436
- results: rawProjectsList
437
- };
330
+ return super.getProjects(data);
438
331
  }
439
332
 
440
333
  /**
@@ -442,33 +335,7 @@ export class User {
442
335
  * Constant : GET_POIS_NO_ADMIN / GET_POIS_ADMIN
443
336
  */
444
337
  async getPois(data = {}) {
445
- delete data?.pathParams;
446
-
447
- const fetchFn = this.isMe
448
- ? () => this.callIsMe(() => this.endpointApi.getPoisAdmin(data))
449
- : () => this.endpointApi.getPoisNoAdmin(data);
450
-
451
-
452
- if (!this.isMe && !data.filters) {
453
- data.filters = {
454
- [`parent.${this.id}`]: { "$exists": true },
455
- };
456
- }
457
-
458
- const arrayObjetPois = await fetchFn();
459
- if (!Array.isArray(arrayObjetPois.results)) {
460
- throw new ApiResponseError("Erreur lors de la récupération des POIs.", 500, arrayObjetPois.results);
461
- }
462
-
463
- // lier les entités au objets
464
- const rawPoisList = arrayObjetPois.results.map(
465
- (d) => this.linkEntity?.(d.collection, d) ?? d
466
- );
467
-
468
- return {
469
- count: arrayObjetPois.count?.poi ?? 0,
470
- results: rawPoisList
471
- };
338
+ return super.getPois(data);
472
339
  }
473
340
 
474
341
  /**
@@ -476,23 +343,7 @@ export class User {
476
343
  * Constant : GET_NEWS
477
344
  */
478
345
  async getNews(data = {}) {
479
- if (data.pathParams) {
480
- delete data.pathParams;
481
- }
482
- if (!this.isMe){
483
- // is not me add id
484
- data.pathParams = { id: this.id };
485
- }
486
- const arrayObjetNews = await this.endpointApi.getNews(data);
487
- if(!Array.isArray(arrayObjetNews)){
488
- throw new ApiResponseError("Erreur lors de la récupération des actualités.", 500, arrayObjetNews);
489
- }
490
-
491
- const rawNewsList = arrayObjetNews.map(
492
- (d) => this.linkEntity?.(d.collection, d) ?? d
493
- );
494
-
495
- return this._createFilteredProxy(rawNewsList);
346
+ return super.getNews(data);
496
347
  }
497
348
 
498
349
  /**
@@ -509,19 +360,17 @@ export class User {
509
360
  data.pathParams = { id: this.id };
510
361
  }
511
362
 
512
- const arrayObjetFriends = await this.endpointApi.getFriendsAdmin(data);
513
- if(!Array.isArray(arrayObjetFriends.results)){
514
- throw new ApiResponseError("Erreur lors de la récupération des amis administrables.", 500, arrayObjetFriends);
363
+ const arrayObjet = await this.endpointApi.getFriendsAdmin(data);
364
+ if(!Array.isArray(arrayObjet.results)){
365
+ throw new ApiResponseError("Erreur lors de la récupération des amis administrables.", 500, arrayObjet);
515
366
 
516
367
  }
517
368
 
518
- const rawFriendsList = arrayObjetFriends.results.map(
519
- (d) => this.linkEntity?.(d.collection, d) ?? d
520
- );
369
+ const rawList = this._linkEntities(arrayObjet.results);
521
370
 
522
371
  return {
523
- count: arrayObjetFriends?.count?.citoyens ?? 0,
524
- results: rawFriendsList
372
+ count: arrayObjet?.count?.citoyens ?? 0,
373
+ results: rawList
525
374
  };
526
375
  }
527
376
 
@@ -542,19 +391,17 @@ export class User {
542
391
  };
543
392
  }
544
393
 
545
- const arrayObjetSubscriptions = await fetchFn();
546
- if (!Array.isArray(arrayObjetSubscriptions.results)) {
547
- throw new ApiResponseError("Erreur lors de la récupération des abonnements.", 500, arrayObjetSubscriptions.results);
394
+ const arrayObjet = await fetchFn();
395
+ if (!Array.isArray(arrayObjet.results)) {
396
+ throw new ApiResponseError("Erreur lors de la récupération des abonnements.", 500, arrayObjet.results);
548
397
  }
549
398
 
550
399
  // lier les entités au objets
551
- const rawSubscriptionsList = arrayObjetSubscriptions.results.map(
552
- (d) => this.linkEntity?.(d.collection, d) ?? d
553
- );
400
+ const rawList = this._linkEntities(arrayObjet.results);
554
401
 
555
402
  return {
556
- count: arrayObjetSubscriptions.count,
557
- results: rawSubscriptionsList
403
+ count: arrayObjet.count,
404
+ results: rawList
558
405
  };
559
406
  }
560
407
 
@@ -563,28 +410,7 @@ export class User {
563
410
  * Constant : GET_SUBSCRIBERS
564
411
  */
565
412
  async getSubscribers(data = {}) {
566
- delete data?.pathParams;
567
-
568
- if (!this.isMe && !data.filters) {
569
- data.filters = {
570
- [`links.follows.${this.id}`]: { "$exists": true },
571
- };
572
- }
573
-
574
- const arrayObjetSubscribers = await this.endpointApi.getSubscribers(data);
575
- if (!Array.isArray(arrayObjetSubscribers.results)) {
576
- throw new ApiResponseError("Erreur lors de la récupération des abonnés.", 500, arrayObjetSubscribers.results);
577
- }
578
-
579
- // lier les entités au objets
580
- const rawSubscribersList = arrayObjetSubscribers.results.map(
581
- (d) => this.linkEntity?.(d.collection, d) ?? d
582
- );
583
-
584
- return {
585
- count: arrayObjetSubscribers.count,
586
- results: rawSubscribersList
587
- };
413
+ return super.getSubscribers(data);
588
414
  }
589
415
 
590
416
  /**
@@ -598,26 +424,7 @@ export class User {
598
424
  * Constant : GET_BADGES
599
425
  */
600
426
  async getBadgesIssuer(data = {}) {
601
- delete data?.pathParams;
602
-
603
- data.filters = data.filters || {};
604
- data.filters["$or"] = {};
605
- data.filters["$or"][`issuer.${this.id}`] = { "$exists": true };
606
-
607
- const arrayObjetBadges = await this.endpointApi.getBadges(data);
608
- if (!Array.isArray(arrayObjetBadges.results)) {
609
- throw new ApiResponseError("Erreur lors de la récupération des badges.", 500, arrayObjetBadges.results);
610
- }
611
-
612
- // lier les entités au objets
613
- const rawBadgesList = arrayObjetBadges.results.map(
614
- (d) => this.linkEntity?.(d.collection, d) ?? d
615
- );
616
-
617
- return {
618
- count: arrayObjetBadges.count?.badges ?? 0,
619
- results: rawBadgesList
620
- };
427
+ return super.getBadgesIssuer(data);
621
428
  }
622
429
 
623
430
  /**
@@ -655,7 +462,7 @@ export class User {
655
462
  if(!this.isMe){
656
463
  throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.");
657
464
  }
658
- return this.entity("organizations", organizationData);
465
+ return super.organization(organizationData);
659
466
  }
660
467
 
661
468
  /**
@@ -669,7 +476,7 @@ export class User {
669
476
  if(!this.isMe){
670
477
  throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un projet.");
671
478
  }
672
- return this.entity("projects", projectData);
479
+ return super.project(projectData);
673
480
  }
674
481
 
675
482
  /**
@@ -683,7 +490,7 @@ export class User {
683
490
  if(!this.isMe){
684
491
  throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une actualité.");
685
492
  }
686
- return this.entity("news", newsData);
493
+ return super.news(newsData);
687
494
  }
688
495
 
689
496
  /**
@@ -697,7 +504,7 @@ export class User {
697
504
  if(!this.isMe){
698
505
  throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un POI.");
699
506
  }
700
- return this.entity("poi", poiData);
507
+ return super.poi(poiData);
701
508
  }
702
509
 
703
510
  /**
@@ -711,7 +518,7 @@ export class User {
711
518
  if(!this.isMe){
712
519
  throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un événement.");
713
520
  }
714
- return this.entity("events", eventData);
521
+ return super.event(eventData);
715
522
  }
716
523
 
717
524
  /**
@@ -725,54 +532,11 @@ export class User {
725
532
  if(!this.isMe){
726
533
  throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un badge.");
727
534
  }
728
- return this.entity("badges", badgeData);
535
+ return super.badge(badgeData);
729
536
  }
730
537
 
731
- _updateInitialDraftSnapshot() {
732
- this._initialDraftData = JSON.parse(JSON.stringify(this._draftData));
733
- }
734
-
735
- // TODO: ne fonctionne pas
736
- hasChanges() {
737
- return JSON.stringify(this._draftData) !== JSON.stringify(this._initialDraftData);
738
- }
739
-
740
- /**
741
- * Champs par défaut pour les schemas json ou l'on extrait les fields. (pour les if/else/then)
742
- *
743
- * @property {Object} defaultFields - Un objet contenant les propriétés par défaut pour l'entité User.
744
- */
745
- defaultFields = {
746
- typeElement: this.getEntityType(),
747
- };
748
-
749
- /**
750
- * Champs à supprimer de draft lors de la construction du proxy.
751
- *
752
- * @property {Array<string>} removeFields - Un tableau de chaînes représentant les champs à supprimer.
753
- */
754
- removeFields = [
755
- "typeElement",
756
- ];
757
-
758
- /**
759
- * Transformateurs appliqués lors de la lecture du draft.
760
- *
761
- * @type {Object<string, function>}
762
- */
763
- transforms = {
764
- github: (val, full) => full?.socialNetwork?.github,
765
- gitlab: (val, full) => full?.socialNetwork?.gitlab,
766
- facebook: (val, full) => full?.socialNetwork?.facebook,
767
- twitter: (val, full) => full?.socialNetwork?.twitter,
768
- instagram: (val, full) => full?.socialNetwork?.instagram,
769
- diaspora: (val, full) => full?.socialNetwork?.diaspora,
770
- mastodon: (val, full) => full?.socialNetwork?.mastodon,
771
- telegram: (val, full) => full?.socialNetwork?.telegram,
772
- signal: (val, full) => full?.socialNetwork?.signal
773
- };
774
538
  }
775
539
 
776
540
  // Incorporation des mixins dans User
777
- Object.assign(User.prototype, MutualEntityMixin, UtilMixin, UserMixin, DraftStateMixin);
541
+ Object.assign(User.prototype, UserMixin);
778
542