@communecter/cocolight-api-client 1.0.109 → 1.0.110

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.109",
3
+ "version": "1.0.110",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
package/src/api/User.ts CHANGED
@@ -1067,7 +1067,11 @@ export class User extends BaseEntity<UserItemNormalized> {
1067
1067
  * }
1068
1068
  */
1069
1069
  override isAdmin(): boolean {
1070
- this._validateMemberPreconditions("isAdmin", ["organizations", "projects"]);
1070
+ try {
1071
+ this._validateMemberPreconditions("isAdmin", ["organizations", "projects"]);
1072
+ } catch{
1073
+ return false;
1074
+ }
1071
1075
  const parentLink = this._getParentLinkForUser();
1072
1076
  return this._validateUserLink(parentLink) && parentLink?.isAdmin === true;
1073
1077
  }
@@ -1098,7 +1102,11 @@ export class User extends BaseEntity<UserItemNormalized> {
1098
1102
  * }
1099
1103
  */
1100
1104
  override isMember(): boolean {
1101
- this._validateMemberPreconditions("isMember", ["organizations"]);
1105
+ try {
1106
+ this._validateMemberPreconditions("isMember", ["organizations"]);
1107
+ } catch{
1108
+ return false;
1109
+ }
1102
1110
  const parentLink = this._getParentLinkForUser();
1103
1111
  return this._validateUserLink(parentLink);
1104
1112
  }
@@ -1129,7 +1137,11 @@ export class User extends BaseEntity<UserItemNormalized> {
1129
1137
  * }
1130
1138
  */
1131
1139
  override isContributor(): boolean {
1132
- this._validateMemberPreconditions("isContributor", ["projects"]);
1140
+ try {
1141
+ this._validateMemberPreconditions("isContributor", ["projects"]);
1142
+ } catch{
1143
+ return false;
1144
+ }
1133
1145
  const parentLink = this._getParentLinkForUser();
1134
1146
  return this._validateUserLink(parentLink);
1135
1147
  }
@@ -1160,7 +1172,11 @@ export class User extends BaseEntity<UserItemNormalized> {
1160
1172
  * }
1161
1173
  */
1162
1174
  override isAttendee(): boolean {
1163
- this._validateMemberPreconditions("isAttendee", ["events"]);
1175
+ try {
1176
+ this._validateMemberPreconditions("isAttendee", ["events"]);
1177
+ } catch{
1178
+ return false;
1179
+ }
1164
1180
  const parentLink = this._getParentLinkForUser();
1165
1181
  return this._validateUserLink(parentLink);
1166
1182
  }
@@ -1183,7 +1199,11 @@ export class User extends BaseEntity<UserItemNormalized> {
1183
1199
  * ```
1184
1200
  */
1185
1201
  isInviting(): boolean {
1186
- this._validateMemberPreconditions("isInviting", ["organizations", "projects", "events"]);
1202
+ try {
1203
+ this._validateMemberPreconditions("isInviting", ["organizations", "projects", "events"]);
1204
+ } catch{
1205
+ return false;
1206
+ }
1187
1207
  const parentLink = this._getParentLinkForUser();
1188
1208
  if (!parentLink) return false;
1189
1209
  return parentLink?.isInviting === true;
@@ -1207,7 +1227,11 @@ export class User extends BaseEntity<UserItemNormalized> {
1207
1227
  * ```
1208
1228
  */
1209
1229
  isInvitingAdmin(): boolean {
1210
- this._validateMemberPreconditions("isInvitingAdmin", ["organizations", "projects"]);
1230
+ try {
1231
+ this._validateMemberPreconditions("isInvitingAdmin", ["organizations", "projects"]);
1232
+ } catch{
1233
+ return false;
1234
+ }
1211
1235
  const parentLink = this._getParentLinkForUser();
1212
1236
  if (!parentLink) return false;
1213
1237
  return (parentLink?.isAdminInviting === true || parentLink?.isInviting === true) && parentLink?.isAdmin === true;
@@ -1233,7 +1257,11 @@ export class User extends BaseEntity<UserItemNormalized> {
1233
1257
  * ```
1234
1258
  */
1235
1259
  isAdminPending(): boolean {
1236
- this._validateMemberPreconditions("isAdminPending", ["organizations", "projects"]);
1260
+ try {
1261
+ this._validateMemberPreconditions("isAdminPending", ["organizations", "projects"]);
1262
+ } catch{
1263
+ return false;
1264
+ }
1237
1265
  const parentLink = this._getParentLinkForUser();
1238
1266
  return parentLink?.isAdmin === true && parentLink?.isAdminPending === true;
1239
1267
  }
@@ -1258,7 +1286,11 @@ export class User extends BaseEntity<UserItemNormalized> {
1258
1286
  * ```
1259
1287
  */
1260
1288
  isToBeValidated(): boolean {
1261
- this._validateMemberPreconditions("isToBeValidated", ["organizations", "projects", "events"]);
1289
+ try {
1290
+ this._validateMemberPreconditions("isToBeValidated", ["organizations", "projects", "events"]);
1291
+ } catch{
1292
+ return false;
1293
+ }
1262
1294
  const parentLink = this._getParentLinkForUser();
1263
1295
  return parentLink?.toBeValidated === true;
1264
1296
  }