@communecter/cocolight-api-client 1.0.33 → 1.0.35
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/cocolight-api-client.browser.js +2 -2
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
- package/package.json +1 -1
- package/src/Api.js +14 -0
- package/src/api/BaseEntity.js +45 -39
- package/src/api/EndpointApi.js +120 -0
- package/src/api/EndpointApi.types.d.ts +377 -0
- package/src/api/EntityRegistry.js +2 -2
- package/src/api/Event.js +122 -0
- package/src/endpoints.module.js +2 -2
- package/dist/cocolight-api-client.cjs.LICENSE.txt +0 -5
- package/dist/cocolight-api-client.mjs.js.LICENSE.txt +0 -5
package/package.json
CHANGED
package/src/Api.js
CHANGED
|
@@ -186,6 +186,20 @@ export default class Api {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
async event(eventData) {
|
|
190
|
+
try {
|
|
191
|
+
const event = new Event(this._client, eventData, { EndpointApi, User, Organization, Project, Poi, Badge, News });
|
|
192
|
+
if (!eventData.id && !eventData.slug) {
|
|
193
|
+
throw new Error("Vous devez fournir un id ou un slug pour créer une instance Event.");
|
|
194
|
+
}
|
|
195
|
+
await event.get();
|
|
196
|
+
return event;
|
|
197
|
+
} catch (error) {
|
|
198
|
+
console.error("[Api.event] Erreur lors de la création d'un objet événement :", error.message);
|
|
199
|
+
throw error;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
189
203
|
/**
|
|
190
204
|
* Retourne l'instance d'ApiClient.
|
|
191
205
|
*
|
package/src/api/BaseEntity.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// BaseEntity.js
|
|
2
2
|
import ObjectID from "bson-objectid";
|
|
3
3
|
// import { fileTypeFromBuffer } from "file-type";
|
|
4
|
+
import EJSON from "ejson";
|
|
4
5
|
import pkg from "file-type";
|
|
5
6
|
|
|
6
7
|
import { ApiAuthenticationError, ApiError, ApiResponseError, ApiValidationError } from "../error.js";
|
|
@@ -282,75 +283,80 @@ export class BaseEntity {
|
|
|
282
283
|
if (this.parent?.id) parentMeta.id = this.parent.id;
|
|
283
284
|
if (typeof this.parent?.getEntityType === "function") parentMeta.type = this.parent.getEntityType();
|
|
284
285
|
if (this.parent?.__entityTag) parentMeta.__entityTag = this.parent.__entityTag;
|
|
286
|
+
if (this.parent?.slug) parentMeta.slug = this.parent.slug;
|
|
285
287
|
|
|
286
288
|
return {
|
|
287
289
|
__entityTag: this.__entityTag,
|
|
288
|
-
|
|
290
|
+
__isSerializedEntity: true,
|
|
291
|
+
serverData: this._serialize(this._serverData),
|
|
289
292
|
parent: Object.keys(parentMeta).length > 0 ? parentMeta : null
|
|
290
293
|
};
|
|
291
294
|
}
|
|
292
295
|
|
|
293
|
-
|
|
296
|
+
|
|
297
|
+
_serialize(obj) {
|
|
298
|
+
try {
|
|
299
|
+
return JSON.parse(EJSON.stringify(this._removeUnserializables(obj)));
|
|
300
|
+
} catch (e) {
|
|
301
|
+
this.apiClient?._logger?.error?.("Erreur de sérialisation EJSON", e);
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Supprime les propriétés non sérialisables d'un objet.
|
|
308
|
+
*
|
|
309
|
+
* @param {Object} obj - L'objet à nettoyer.
|
|
310
|
+
* @param {WeakSet} [seen] - Ensemble pour éviter les références circulaires.
|
|
311
|
+
* @returns {Object} L'objet nettoyé.
|
|
312
|
+
* @private
|
|
313
|
+
*/
|
|
314
|
+
_removeUnserializables(obj, seen = new WeakSet()) {
|
|
294
315
|
if (obj === null || typeof obj !== "object") return obj;
|
|
295
316
|
|
|
296
|
-
// Évite les boucles circulaires
|
|
297
317
|
if (seen.has(obj)) return null;
|
|
298
318
|
seen.add(obj);
|
|
299
319
|
|
|
300
|
-
//
|
|
301
|
-
if (obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]") {
|
|
302
|
-
return obj.toISOString();
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// Si c'est un Proxy réactif de ton système maison
|
|
320
|
+
// Ignore les proxys réactifs
|
|
306
321
|
if (obj.__isReactive && typeof obj.__raw === "object") {
|
|
307
|
-
return this.
|
|
322
|
+
return this._removeUnserializables(obj.__raw, seen);
|
|
308
323
|
}
|
|
309
324
|
|
|
310
|
-
// Tableaux
|
|
311
325
|
if (Array.isArray(obj)) {
|
|
312
|
-
return obj.map((
|
|
326
|
+
return obj.map((el) => this._removeUnserializables(el, seen));
|
|
313
327
|
}
|
|
314
328
|
|
|
315
|
-
|
|
316
|
-
const result = {};
|
|
329
|
+
const clean = {};
|
|
317
330
|
for (const key of Object.keys(obj)) {
|
|
318
|
-
const
|
|
331
|
+
const val = obj[key];
|
|
319
332
|
|
|
320
|
-
|
|
321
|
-
|
|
333
|
+
if (
|
|
334
|
+
typeof val === "function" ||
|
|
335
|
+
typeof val === "symbol" ||
|
|
336
|
+
typeof val === "undefined"
|
|
337
|
+
) {
|
|
322
338
|
continue;
|
|
323
339
|
}
|
|
324
340
|
|
|
325
341
|
try {
|
|
326
|
-
|
|
342
|
+
clean[key] = this._removeUnserializables(val, seen);
|
|
327
343
|
// eslint-disable-next-line no-unused-vars
|
|
328
344
|
} catch (e) {
|
|
329
|
-
|
|
345
|
+
clean[key] = null;
|
|
330
346
|
}
|
|
331
347
|
}
|
|
332
348
|
|
|
333
|
-
return
|
|
349
|
+
return clean;
|
|
334
350
|
}
|
|
335
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Restaure les données sérialisées en un objet d'origine.
|
|
354
|
+
*
|
|
355
|
+
* @param {Object} obj - L'objet à restaurer.
|
|
356
|
+
* @returns {Object} L'objet restauré.
|
|
357
|
+
*/
|
|
336
358
|
static _revive(obj) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
// Détecter et restaurer les ISO string en Date
|
|
340
|
-
if (typeof obj === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/.test(obj)) {
|
|
341
|
-
return new Date(obj);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
if (Array.isArray(obj)) {
|
|
345
|
-
return obj.map((item) => this._revive(item));
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
const result = {};
|
|
349
|
-
for (const key of Object.keys(obj)) {
|
|
350
|
-
result[key] = this._revive(obj[key]);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
return result;
|
|
359
|
+
return EJSON.fromJSONValue(obj);
|
|
354
360
|
}
|
|
355
361
|
|
|
356
362
|
/**
|
|
@@ -363,9 +369,9 @@ export class BaseEntity {
|
|
|
363
369
|
*/
|
|
364
370
|
static fromJSON(json, parent, deps) {
|
|
365
371
|
|
|
366
|
-
const {
|
|
372
|
+
const { serverData } = json;
|
|
367
373
|
|
|
368
|
-
const instance = this.fromServerData(this._revive(
|
|
374
|
+
const instance = this.fromServerData(this._revive(serverData), parent, deps);
|
|
369
375
|
|
|
370
376
|
return instance;
|
|
371
377
|
}
|
package/src/api/EndpointApi.js
CHANGED
|
@@ -1378,6 +1378,126 @@ class EndpointApi {
|
|
|
1378
1378
|
return this.call("GLOBAL_AUTOCOMPLETE_COSTUM", data);
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
|
+
/**
|
|
1382
|
+
* Récupérer les acteurs d'événement : Récupérer les acteurs (organizers, attendees, creators, animators) d'une entité événement.
|
|
1383
|
+
* Constant : COSTUM_EVENT_REQUEST_ACTORS
|
|
1384
|
+
* @param {import("./EndpointApi.types").CostumEventRequestActorsData} data - Données envoyées à l'API
|
|
1385
|
+
* @returns {Promise<Object>} - Les données de réponse.
|
|
1386
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1387
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1388
|
+
*/
|
|
1389
|
+
async costumEventRequestActors(data) {
|
|
1390
|
+
if (!data || typeof data !== "object") {
|
|
1391
|
+
throw new TypeError("Le paramètre data doit être un objet.");
|
|
1392
|
+
}
|
|
1393
|
+
return this.call("COSTUM_EVENT_REQUEST_ACTORS", data);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* Récupérer les sous-événements d’un événement parent : Retourne les sous-événements filtrés par date, type, tags, région, timezone.
|
|
1398
|
+
* Constant : COSTUM_EVENT_REQUEST_SUBEVENTS
|
|
1399
|
+
* @param {import("./EndpointApi.types").CostumEventRequestSubeventsData} data - Données envoyées à l'API
|
|
1400
|
+
* @returns {Promise<Object>} - Les données de réponse.
|
|
1401
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1402
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1403
|
+
*/
|
|
1404
|
+
async costumEventRequestSubevents(data) {
|
|
1405
|
+
if (!data || typeof data !== "object") {
|
|
1406
|
+
throw new TypeError("Le paramètre data doit être un objet.");
|
|
1407
|
+
}
|
|
1408
|
+
return this.call("COSTUM_EVENT_REQUEST_SUBEVENTS", data);
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Récupérer les événements liés à un élément : Retourne les événements liés à une entité (via links.events ou parent).
|
|
1413
|
+
* Constant : COSTUM_EVENT_REQUEST_ELEMENT_EVENT
|
|
1414
|
+
* @param {import("./EndpointApi.types").CostumEventRequestElementEventData} data - Données envoyées à l'API
|
|
1415
|
+
* @returns {Promise<Object>} - Les données de réponse.
|
|
1416
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1417
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1418
|
+
*/
|
|
1419
|
+
async costumEventRequestElementEvent(data) {
|
|
1420
|
+
if (!data || typeof data !== "object") {
|
|
1421
|
+
throw new TypeError("Le paramètre data doit être un objet.");
|
|
1422
|
+
}
|
|
1423
|
+
return this.call("COSTUM_EVENT_REQUEST_ELEMENT_EVENT", data);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Récupérer les catégories d’événements : Retourne la liste des types (catégories) d’événements enfants liés à l'entité.
|
|
1428
|
+
* Constant : COSTUM_EVENT_REQUEST_CATEGORIES
|
|
1429
|
+
* @param {import("./EndpointApi.types").CostumEventRequestCategoriesData} data - Données envoyées à l'API
|
|
1430
|
+
* @returns {Promise<Object>} - Les données de réponse.
|
|
1431
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1432
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1433
|
+
*/
|
|
1434
|
+
async costumEventRequestCategories(data) {
|
|
1435
|
+
if (!data || typeof data !== "object") {
|
|
1436
|
+
throw new TypeError("Le paramètre data doit être un objet.");
|
|
1437
|
+
}
|
|
1438
|
+
return this.call("COSTUM_EVENT_REQUEST_CATEGORIES", data);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* Récupérer les dates de sous-événements : Retourne les dates des sous-événements à venir et passés, groupées par jour.
|
|
1443
|
+
* Constant : COSTUM_EVENT_REQUEST_DATES
|
|
1444
|
+
* @param {import("./EndpointApi.types").CostumEventRequestDatesData} data - Données envoyées à l'API
|
|
1445
|
+
* @returns {Promise<Object>} - Les données de réponse.
|
|
1446
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1447
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1448
|
+
*/
|
|
1449
|
+
async costumEventRequestDates(data) {
|
|
1450
|
+
if (!data || typeof data !== "object") {
|
|
1451
|
+
throw new TypeError("Le paramètre data doit être un objet.");
|
|
1452
|
+
}
|
|
1453
|
+
return this.call("COSTUM_EVENT_REQUEST_DATES", data);
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* Récupérer un événement par ID : Retourne les informations détaillées d’un événement par son ID.
|
|
1458
|
+
* Constant : COSTUM_EVENT_REQUEST_EVENT
|
|
1459
|
+
* @param {import("./EndpointApi.types").CostumEventRequestEventData} data - Données envoyées à l'API
|
|
1460
|
+
* @returns {Promise<Object>} - Les données de réponse.
|
|
1461
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1462
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1463
|
+
*/
|
|
1464
|
+
async costumEventRequestEvent(data) {
|
|
1465
|
+
if (!data || typeof data !== "object") {
|
|
1466
|
+
throw new TypeError("Le paramètre data doit être un objet.");
|
|
1467
|
+
}
|
|
1468
|
+
return this.call("COSTUM_EVENT_REQUEST_EVENT", data);
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Associer une structure à un événement (adresse) : Associe une structure existante à un événement en copiant son adresse.
|
|
1473
|
+
* Constant : COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT
|
|
1474
|
+
* @param {import("./EndpointApi.types").CostumEventRequestLinkTlToEventData} data - Données envoyées à l'API
|
|
1475
|
+
* @returns {Promise<Object>} - Les données de réponse.
|
|
1476
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1477
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1478
|
+
*/
|
|
1479
|
+
async costumEventRequestLinkTlToEvent(data) {
|
|
1480
|
+
if (!data || typeof data !== "object") {
|
|
1481
|
+
throw new TypeError("Le paramètre data doit être un objet.");
|
|
1482
|
+
}
|
|
1483
|
+
return this.call("COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT", data);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/**
|
|
1487
|
+
* Charger les tags de contexte d’un événement : Retourne les tags des sous-événements et des parents d’un événement, avec filtre optionnel.
|
|
1488
|
+
* Constant : COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG
|
|
1489
|
+
* @param {import("./EndpointApi.types").CostumEventRequestLoadContextTagData} data - Données envoyées à l'API
|
|
1490
|
+
* @returns {Promise<Object>} - Les données de réponse.
|
|
1491
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1492
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1493
|
+
*/
|
|
1494
|
+
async costumEventRequestLoadContextTag(data) {
|
|
1495
|
+
if (!data || typeof data !== "object") {
|
|
1496
|
+
throw new TypeError("Le paramètre data doit être un objet.");
|
|
1497
|
+
}
|
|
1498
|
+
return this.call("COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG", data);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1381
1501
|
}
|
|
1382
1502
|
|
|
1383
1503
|
export default EndpointApi;
|
|
@@ -4023,3 +4023,380 @@ export interface GlobalAutocompleteCostumData {
|
|
|
4023
4023
|
};
|
|
4024
4024
|
[k: string]: unknown;
|
|
4025
4025
|
}
|
|
4026
|
+
|
|
4027
|
+
|
|
4028
|
+
export interface CostumEventRequestActorsData {
|
|
4029
|
+
/**
|
|
4030
|
+
* Types de liens à inclure (ex: organizer, attendees, creator, animator)
|
|
4031
|
+
*/
|
|
4032
|
+
types?: (
|
|
4033
|
+
| "organizer"
|
|
4034
|
+
| "links.attendees"
|
|
4035
|
+
| "creator"
|
|
4036
|
+
| "links.creator"
|
|
4037
|
+
| "links.organizer"
|
|
4038
|
+
| "organizerName"
|
|
4039
|
+
| "animator"
|
|
4040
|
+
)[];
|
|
4041
|
+
/**
|
|
4042
|
+
* Limiter aux sous-événements liés directement
|
|
4043
|
+
*/
|
|
4044
|
+
parent_only?: boolean;
|
|
4045
|
+
/**
|
|
4046
|
+
* ID du contexte de recherche (actuellement vide)
|
|
4047
|
+
*/
|
|
4048
|
+
contextId?: string;
|
|
4049
|
+
/**
|
|
4050
|
+
* Type de contexte de recherche (actuellement vide)
|
|
4051
|
+
*/
|
|
4052
|
+
contextType?: "projects" | "organizations";
|
|
4053
|
+
/**
|
|
4054
|
+
* Slug du costume utilisé pour la recherche
|
|
4055
|
+
*/
|
|
4056
|
+
costumSlug?: string;
|
|
4057
|
+
/**
|
|
4058
|
+
* Clés de source pour la recherche
|
|
4059
|
+
*/
|
|
4060
|
+
sourceKey?: string[];
|
|
4061
|
+
/**
|
|
4062
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
4063
|
+
*/
|
|
4064
|
+
costumEditMode?: boolean;
|
|
4065
|
+
pathParams?: {
|
|
4066
|
+
/**
|
|
4067
|
+
* ID de l'entité
|
|
4068
|
+
*/
|
|
4069
|
+
id: string;
|
|
4070
|
+
/**
|
|
4071
|
+
* Type d'entité (ex: events)
|
|
4072
|
+
*/
|
|
4073
|
+
type: string;
|
|
4074
|
+
[k: string]: unknown;
|
|
4075
|
+
};
|
|
4076
|
+
[k: string]: unknown;
|
|
4077
|
+
}
|
|
4078
|
+
|
|
4079
|
+
|
|
4080
|
+
export interface CostumEventRequestSubeventsData {
|
|
4081
|
+
/**
|
|
4082
|
+
* Filtrage par type d’événement
|
|
4083
|
+
*/
|
|
4084
|
+
type?: string;
|
|
4085
|
+
/**
|
|
4086
|
+
* Liste de tags à filtrer
|
|
4087
|
+
*/
|
|
4088
|
+
tags?: string[];
|
|
4089
|
+
/**
|
|
4090
|
+
* Régions à filtrer
|
|
4091
|
+
*/
|
|
4092
|
+
regions?: {
|
|
4093
|
+
/**
|
|
4094
|
+
* ID de la région
|
|
4095
|
+
*/
|
|
4096
|
+
id: string;
|
|
4097
|
+
[k: string]: unknown;
|
|
4098
|
+
}[];
|
|
4099
|
+
/**
|
|
4100
|
+
* Si vrai, ne renvoie que les événements à venir
|
|
4101
|
+
*/
|
|
4102
|
+
fromToday?: boolean;
|
|
4103
|
+
/**
|
|
4104
|
+
* Filtrage par date unique ou intervalle
|
|
4105
|
+
*/
|
|
4106
|
+
date?:
|
|
4107
|
+
| string
|
|
4108
|
+
| {
|
|
4109
|
+
between: {
|
|
4110
|
+
start: string;
|
|
4111
|
+
end: string;
|
|
4112
|
+
[k: string]: unknown;
|
|
4113
|
+
};
|
|
4114
|
+
[k: string]: unknown;
|
|
4115
|
+
};
|
|
4116
|
+
/**
|
|
4117
|
+
* Timezone à appliquer sur les dates
|
|
4118
|
+
*/
|
|
4119
|
+
timezone?: string;
|
|
4120
|
+
/**
|
|
4121
|
+
* ID du contexte de recherche (actuellement vide)
|
|
4122
|
+
*/
|
|
4123
|
+
contextId?: string;
|
|
4124
|
+
/**
|
|
4125
|
+
* Type de contexte de recherche (actuellement vide)
|
|
4126
|
+
*/
|
|
4127
|
+
contextType?: "projects" | "organizations";
|
|
4128
|
+
/**
|
|
4129
|
+
* Slug du costume utilisé pour la recherche
|
|
4130
|
+
*/
|
|
4131
|
+
costumSlug?: string;
|
|
4132
|
+
/**
|
|
4133
|
+
* Clés de source pour la recherche
|
|
4134
|
+
*/
|
|
4135
|
+
sourceKey?: string[];
|
|
4136
|
+
/**
|
|
4137
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
4138
|
+
*/
|
|
4139
|
+
costumEditMode?: boolean;
|
|
4140
|
+
pathParams?: {
|
|
4141
|
+
/**
|
|
4142
|
+
* ID de l'entité
|
|
4143
|
+
*/
|
|
4144
|
+
id: string;
|
|
4145
|
+
/**
|
|
4146
|
+
* Type d'entité (ex: events)
|
|
4147
|
+
*/
|
|
4148
|
+
type: string;
|
|
4149
|
+
[k: string]: unknown;
|
|
4150
|
+
};
|
|
4151
|
+
[k: string]: unknown;
|
|
4152
|
+
}
|
|
4153
|
+
|
|
4154
|
+
|
|
4155
|
+
export interface CostumEventRequestElementEventData {
|
|
4156
|
+
/**
|
|
4157
|
+
* ID du contexte de recherche (actuellement vide)
|
|
4158
|
+
*/
|
|
4159
|
+
contextId?: string;
|
|
4160
|
+
/**
|
|
4161
|
+
* Type de contexte de recherche (actuellement vide)
|
|
4162
|
+
*/
|
|
4163
|
+
contextType?: "projects" | "organizations";
|
|
4164
|
+
/**
|
|
4165
|
+
* Slug du costume utilisé pour la recherche
|
|
4166
|
+
*/
|
|
4167
|
+
costumSlug?: string;
|
|
4168
|
+
/**
|
|
4169
|
+
* Clés de source pour la recherche
|
|
4170
|
+
*/
|
|
4171
|
+
sourceKey?: string[];
|
|
4172
|
+
/**
|
|
4173
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
4174
|
+
*/
|
|
4175
|
+
costumEditMode?: boolean;
|
|
4176
|
+
pathParams?: {
|
|
4177
|
+
/**
|
|
4178
|
+
* ID de l'entité
|
|
4179
|
+
*/
|
|
4180
|
+
id: string;
|
|
4181
|
+
/**
|
|
4182
|
+
* Type d'entité (ex: events)
|
|
4183
|
+
*/
|
|
4184
|
+
type: string;
|
|
4185
|
+
[k: string]: unknown;
|
|
4186
|
+
};
|
|
4187
|
+
[k: string]: unknown;
|
|
4188
|
+
}
|
|
4189
|
+
|
|
4190
|
+
|
|
4191
|
+
export interface CostumEventRequestCategoriesData {
|
|
4192
|
+
/**
|
|
4193
|
+
* ID du contexte de recherche (actuellement vide)
|
|
4194
|
+
*/
|
|
4195
|
+
contextId?: string;
|
|
4196
|
+
/**
|
|
4197
|
+
* Type de contexte de recherche (actuellement vide)
|
|
4198
|
+
*/
|
|
4199
|
+
contextType?: "projects" | "organizations";
|
|
4200
|
+
/**
|
|
4201
|
+
* Slug du costume utilisé pour la recherche
|
|
4202
|
+
*/
|
|
4203
|
+
costumSlug?: string;
|
|
4204
|
+
/**
|
|
4205
|
+
* Clés de source pour la recherche
|
|
4206
|
+
*/
|
|
4207
|
+
sourceKey?: string[];
|
|
4208
|
+
/**
|
|
4209
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
4210
|
+
*/
|
|
4211
|
+
costumEditMode?: boolean;
|
|
4212
|
+
pathParams?: {
|
|
4213
|
+
/**
|
|
4214
|
+
* ID de l'entité
|
|
4215
|
+
*/
|
|
4216
|
+
id: string;
|
|
4217
|
+
/**
|
|
4218
|
+
* Type d'entité (ex: events)
|
|
4219
|
+
*/
|
|
4220
|
+
type: string;
|
|
4221
|
+
[k: string]: unknown;
|
|
4222
|
+
};
|
|
4223
|
+
[k: string]: unknown;
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4226
|
+
|
|
4227
|
+
export interface CostumEventRequestDatesData {
|
|
4228
|
+
/**
|
|
4229
|
+
* Filtrage par type
|
|
4230
|
+
*/
|
|
4231
|
+
type?: string;
|
|
4232
|
+
/**
|
|
4233
|
+
* Tags à filtrer
|
|
4234
|
+
*/
|
|
4235
|
+
tags?: string[];
|
|
4236
|
+
/**
|
|
4237
|
+
* Régions géographiques à filtrer
|
|
4238
|
+
*/
|
|
4239
|
+
regions?: {
|
|
4240
|
+
/**
|
|
4241
|
+
* ID de la région
|
|
4242
|
+
*/
|
|
4243
|
+
id: string;
|
|
4244
|
+
[k: string]: unknown;
|
|
4245
|
+
}[];
|
|
4246
|
+
/**
|
|
4247
|
+
* ID du contexte de recherche (actuellement vide)
|
|
4248
|
+
*/
|
|
4249
|
+
contextId?: string;
|
|
4250
|
+
/**
|
|
4251
|
+
* Type de contexte de recherche (actuellement vide)
|
|
4252
|
+
*/
|
|
4253
|
+
contextType?: "projects" | "organizations";
|
|
4254
|
+
/**
|
|
4255
|
+
* Slug du costume utilisé pour la recherche
|
|
4256
|
+
*/
|
|
4257
|
+
costumSlug?: string;
|
|
4258
|
+
/**
|
|
4259
|
+
* Clés de source pour la recherche
|
|
4260
|
+
*/
|
|
4261
|
+
sourceKey?: string[];
|
|
4262
|
+
/**
|
|
4263
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
4264
|
+
*/
|
|
4265
|
+
costumEditMode?: boolean;
|
|
4266
|
+
pathParams?: {
|
|
4267
|
+
/**
|
|
4268
|
+
* ID de l'entité
|
|
4269
|
+
*/
|
|
4270
|
+
id: string;
|
|
4271
|
+
/**
|
|
4272
|
+
* Type d'entité (ex: events)
|
|
4273
|
+
*/
|
|
4274
|
+
type: string;
|
|
4275
|
+
[k: string]: unknown;
|
|
4276
|
+
};
|
|
4277
|
+
[k: string]: unknown;
|
|
4278
|
+
}
|
|
4279
|
+
|
|
4280
|
+
|
|
4281
|
+
export interface CostumEventRequestEventData {
|
|
4282
|
+
/**
|
|
4283
|
+
* ID du contexte de recherche (actuellement vide)
|
|
4284
|
+
*/
|
|
4285
|
+
contextId?: string;
|
|
4286
|
+
/**
|
|
4287
|
+
* Type de contexte de recherche (actuellement vide)
|
|
4288
|
+
*/
|
|
4289
|
+
contextType?: "projects" | "organizations";
|
|
4290
|
+
/**
|
|
4291
|
+
* Slug du costume utilisé pour la recherche
|
|
4292
|
+
*/
|
|
4293
|
+
costumSlug?: string;
|
|
4294
|
+
/**
|
|
4295
|
+
* Clés de source pour la recherche
|
|
4296
|
+
*/
|
|
4297
|
+
sourceKey?: string[];
|
|
4298
|
+
/**
|
|
4299
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
4300
|
+
*/
|
|
4301
|
+
costumEditMode?: boolean;
|
|
4302
|
+
pathParams?: {
|
|
4303
|
+
/**
|
|
4304
|
+
* ID de l'entité
|
|
4305
|
+
*/
|
|
4306
|
+
id: string;
|
|
4307
|
+
/**
|
|
4308
|
+
* Type d'entité (ex: events)
|
|
4309
|
+
*/
|
|
4310
|
+
type: string;
|
|
4311
|
+
[k: string]: unknown;
|
|
4312
|
+
};
|
|
4313
|
+
[k: string]: unknown;
|
|
4314
|
+
}
|
|
4315
|
+
|
|
4316
|
+
|
|
4317
|
+
export interface CostumEventRequestLinkTlToEventData {
|
|
4318
|
+
/**
|
|
4319
|
+
* ID de la structure à copier
|
|
4320
|
+
*/
|
|
4321
|
+
tl: string;
|
|
4322
|
+
/**
|
|
4323
|
+
* ID de l’événement cible
|
|
4324
|
+
*/
|
|
4325
|
+
event: string;
|
|
4326
|
+
/**
|
|
4327
|
+
* ID du contexte de recherche (actuellement vide)
|
|
4328
|
+
*/
|
|
4329
|
+
contextId?: string;
|
|
4330
|
+
/**
|
|
4331
|
+
* Type de contexte de recherche (actuellement vide)
|
|
4332
|
+
*/
|
|
4333
|
+
contextType?: "projects" | "organizations";
|
|
4334
|
+
/**
|
|
4335
|
+
* Slug du costume utilisé pour la recherche
|
|
4336
|
+
*/
|
|
4337
|
+
costumSlug?: string;
|
|
4338
|
+
/**
|
|
4339
|
+
* Clés de source pour la recherche
|
|
4340
|
+
*/
|
|
4341
|
+
sourceKey?: string[];
|
|
4342
|
+
/**
|
|
4343
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
4344
|
+
*/
|
|
4345
|
+
costumEditMode?: boolean;
|
|
4346
|
+
pathParams?: {
|
|
4347
|
+
/**
|
|
4348
|
+
* ID de l'entité
|
|
4349
|
+
*/
|
|
4350
|
+
id: string;
|
|
4351
|
+
/**
|
|
4352
|
+
* Type d'entité (ex: events)
|
|
4353
|
+
*/
|
|
4354
|
+
type: string;
|
|
4355
|
+
[k: string]: unknown;
|
|
4356
|
+
};
|
|
4357
|
+
[k: string]: unknown;
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
|
|
4361
|
+
export interface CostumEventRequestLoadContextTagData {
|
|
4362
|
+
/**
|
|
4363
|
+
* ID de l’événement
|
|
4364
|
+
*/
|
|
4365
|
+
event: string;
|
|
4366
|
+
/**
|
|
4367
|
+
* Recherche textuelle dans les tags
|
|
4368
|
+
*/
|
|
4369
|
+
search?: string;
|
|
4370
|
+
/**
|
|
4371
|
+
* ID du contexte de recherche (actuellement vide)
|
|
4372
|
+
*/
|
|
4373
|
+
contextId?: string;
|
|
4374
|
+
/**
|
|
4375
|
+
* Type de contexte de recherche (actuellement vide)
|
|
4376
|
+
*/
|
|
4377
|
+
contextType?: "projects" | "organizations";
|
|
4378
|
+
/**
|
|
4379
|
+
* Slug du costume utilisé pour la recherche
|
|
4380
|
+
*/
|
|
4381
|
+
costumSlug?: string;
|
|
4382
|
+
/**
|
|
4383
|
+
* Clés de source pour la recherche
|
|
4384
|
+
*/
|
|
4385
|
+
sourceKey?: string[];
|
|
4386
|
+
/**
|
|
4387
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
4388
|
+
*/
|
|
4389
|
+
costumEditMode?: boolean;
|
|
4390
|
+
pathParams?: {
|
|
4391
|
+
/**
|
|
4392
|
+
* ID de l'entité
|
|
4393
|
+
*/
|
|
4394
|
+
id: string;
|
|
4395
|
+
/**
|
|
4396
|
+
* Type d'entité (ex: events)
|
|
4397
|
+
*/
|
|
4398
|
+
type: string;
|
|
4399
|
+
[k: string]: unknown;
|
|
4400
|
+
};
|
|
4401
|
+
[k: string]: unknown;
|
|
4402
|
+
}
|
|
@@ -18,8 +18,8 @@ export function registerEntity(tag, EntityClass) {
|
|
|
18
18
|
*/
|
|
19
19
|
export function fromEntityJSON(json, parent = null) {
|
|
20
20
|
if (!json?.__entityTag) return null;
|
|
21
|
-
if (!json.
|
|
22
|
-
const meta = _getEntityMeta(json.
|
|
21
|
+
if (!json.serverData?.collection) return json;
|
|
22
|
+
const meta = _getEntityMeta(json.serverData.collection, json.__entityTag);
|
|
23
23
|
if (!meta) return json;
|
|
24
24
|
if (!meta?.entityClass?.fromJSON) throw new Error(`Classe inconnue ou fromJSON manquant pour ${json.__entityTag}`);
|
|
25
25
|
return meta.entityClass.fromJSON(json, parent, meta.deps);
|