@communecter/cocolight-api-client 1.0.115 → 1.0.116

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@communecter/cocolight-api-client",
3
- "version": "1.0.115",
3
+ "version": "1.0.116",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
package/src/api/User.ts CHANGED
@@ -1222,15 +1222,25 @@ export class User extends BaseEntity<UserItemNormalized> {
1222
1222
  } catch{
1223
1223
  return false;
1224
1224
  }
1225
- if(this.getEntityType() === "citoyens"){
1226
- const userLink = this._getLinkFromConnectedUser();
1227
- if (!userLink) return false;
1228
- return userLink?.isInviting === true;
1229
- } else {
1230
- const parentLink = this._getParentLinkForUser();
1231
- if (!parentLink) return false;
1232
- return parentLink?.isInviting === true;
1225
+ const parentLink = this._getParentLinkForUser();
1226
+ if (!parentLink) return false;
1227
+ return parentLink?.isInviting === true;
1228
+ }
1229
+
1230
+ /**
1231
+ * Vérifie si l'utilisateur connecté a envoyé une invitation d'ami à cet utilisateur.
1232
+ *
1233
+ * @returns - `true` si une invitation d'ami est en attente, `false` sinon.
1234
+ */
1235
+ isInvitingFriend(): boolean {
1236
+ try {
1237
+ this._validateBasePreconditions("isInviting", ["citoyens", "organizations", "projects", "events"]);
1238
+ } catch{
1239
+ return false;
1233
1240
  }
1241
+ const userLink = this._getLinkFromConnectedUser();
1242
+ if (!userLink) return false;
1243
+ return userLink?.isInviting === true;
1234
1244
  }
1235
1245
 
1236
1246
  /**
@@ -1315,15 +1325,25 @@ export class User extends BaseEntity<UserItemNormalized> {
1315
1325
  } catch{
1316
1326
  return false;
1317
1327
  }
1318
- if(this.getEntityType() === "citoyens"){
1319
- const userLink = this._getLinkFromConnectedUser();
1320
- if (!userLink) return false;
1321
- return userLink?.toBeValidated === true;
1322
- } else {
1323
- const parentLink = this._getParentLinkForUser();
1324
- if (!parentLink) return false;
1325
- return parentLink?.toBeValidated === true;
1328
+ const parentLink = this._getParentLinkForUser();
1329
+ if (!parentLink) return false;
1330
+ return parentLink?.toBeValidated === true;
1331
+ }
1332
+
1333
+ /**
1334
+ * Vérifie si cet utilisateur a envoyé une demande d'ami en attente de validation.
1335
+ *
1336
+ * @returns - `true` si une demande d'ami est en attente de validation, `false` sinon.
1337
+ */
1338
+ isToBeValidatedFriend(): boolean {
1339
+ try {
1340
+ this._validateBasePreconditions("isToBeValidated", ["citoyens", "organizations", "projects", "events"]);
1341
+ } catch{
1342
+ return false;
1326
1343
  }
1344
+ const userLink = this._getLinkFromConnectedUser();
1345
+ if (!userLink) return false;
1346
+ return userLink?.toBeValidated === true;
1327
1347
  }
1328
1348
 
1329
1349
  /**
@@ -528,6 +528,12 @@ export declare class User extends BaseEntity<UserItemNormalized> {
528
528
  * ```
529
529
  */
530
530
  isInviting(): boolean;
531
+ /**
532
+ * Vérifie si l'utilisateur connecté a envoyé une invitation d'ami à cet utilisateur.
533
+ *
534
+ * @returns - `true` si une invitation d'ami est en attente, `false` sinon.
535
+ */
536
+ isInvitingFriend(): boolean;
531
537
  /**
532
538
  * Vérifie si l'utilisateur a une invitation en attente avec des droits d'admin.
533
539
  *
@@ -586,6 +592,12 @@ export declare class User extends BaseEntity<UserItemNormalized> {
586
592
  * ```
587
593
  */
588
594
  isToBeValidated(): boolean;
595
+ /**
596
+ * Vérifie si cet utilisateur a envoyé une demande d'ami en attente de validation.
597
+ *
598
+ * @returns - `true` si une demande d'ami est en attente de validation, `false` sinon.
599
+ */
600
+ isToBeValidatedFriend(): boolean;
589
601
  /**
590
602
  * Envoie une demande pour rejoindre l'entité parente.
591
603
  *