@communecter/cocolight-api-client 1.0.130 → 1.0.132

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.
Files changed (48) hide show
  1. package/dist/cocolight-api-client.browser.js +3 -3
  2. package/dist/cocolight-api-client.cjs +1 -1
  3. package/dist/cocolight-api-client.mjs.js +1 -1
  4. package/dist/cocolight-api-client.vite.mjs.js +1 -1
  5. package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/Api.ts +4 -4
  8. package/src/ApiClient.ts +3 -1
  9. package/src/api/Action.ts +535 -4
  10. package/src/api/Answer.ts +4 -1
  11. package/src/api/Badge.ts +5 -0
  12. package/src/api/BaseEntity.ts +118 -7
  13. package/src/api/Classified.ts +4 -0
  14. package/src/api/Comment.ts +3 -0
  15. package/src/api/EndpointApi.ts +96 -1
  16. package/src/api/EndpointApi.types.ts +448 -44
  17. package/src/api/Event.ts +5 -0
  18. package/src/api/Form.ts +64 -2
  19. package/src/api/News.ts +3 -0
  20. package/src/api/Organization.ts +47 -3
  21. package/src/api/Poi.ts +4 -0
  22. package/src/api/Project.ts +61 -0
  23. package/src/api/User.ts +10 -0
  24. package/src/api/serverDataType/Answer.ts +25 -0
  25. package/src/api/serverDataType/Form.ts +84 -4
  26. package/src/api/serverDataType/Organization.ts +13 -0
  27. package/src/api/serverDataType/Project.ts +15 -0
  28. package/src/endpoints.module.ts +1252 -268
  29. package/types/api/Action.d.ts +276 -2
  30. package/types/api/Answer.d.ts +1 -0
  31. package/types/api/Badge.d.ts +1 -0
  32. package/types/api/BaseEntity.d.ts +62 -0
  33. package/types/api/Classified.d.ts +1 -0
  34. package/types/api/Comment.d.ts +1 -0
  35. package/types/api/EndpointApi.d.ts +60 -1
  36. package/types/api/EndpointApi.types.d.ts +397 -41
  37. package/types/api/Event.d.ts +1 -0
  38. package/types/api/Form.d.ts +34 -0
  39. package/types/api/News.d.ts +1 -0
  40. package/types/api/Organization.d.ts +20 -1
  41. package/types/api/Poi.d.ts +1 -0
  42. package/types/api/Project.d.ts +29 -0
  43. package/types/api/User.d.ts +7 -0
  44. package/types/api/serverDataType/Answer.d.ts +22 -0
  45. package/types/api/serverDataType/Form.d.ts +89 -4
  46. package/types/api/serverDataType/Organization.d.ts +13 -0
  47. package/types/api/serverDataType/Project.d.ts +15 -0
  48. package/types/endpoints.module.d.ts +2825 -1491
@@ -78,6 +78,7 @@ type ClassifiedInput = { id: string } | Record<string, any>;
78
78
  type BadgeInput = { id: string } | Record<string, any>;
79
79
  type NewsInput = { id: string } | Record<string, any>;
80
80
  type ActionInput = { id: string } | Record<string, any>;
81
+ type FormInput = { id: string } | Record<string, any>;
81
82
 
82
83
  /**
83
84
  * On force le type de l'import comme une fabrique qui renvoie un objet
@@ -106,6 +107,21 @@ type Action = import("./Action.js").Action;
106
107
  type AnyEntity = User | Organization | Project | Poi | EventEntity | Badge | News | Comment | Answer | Form | Classified | Action;
107
108
  type ParentLike = BaseEntity<any> & { apiClient: ApiClient, userContext?: User | null };
108
109
 
110
+ /**
111
+ * Variantes d'endpoint disponibles pour `searchCostum`.
112
+ * Tous les variants doivent accepter le même schéma de requête/réponse que
113
+ * `GLOBAL_AUTOCOMPLETE_COSTUM` (drop-in remplacement).
114
+ *
115
+ * - `default` → `/co2/search/globalautocomplete`
116
+ * - `navigator-tl` → `/costum/navigator/gettl`
117
+ */
118
+ export type SearchCostumVariant = "default" | "navigator-tl";
119
+
120
+ const SEARCH_COSTUM_ENDPOINTS = {
121
+ "default": "globalAutocompleteCostum",
122
+ "navigator-tl": "navigatorGettl",
123
+ } as const satisfies Record<SearchCostumVariant, keyof EndpointApi>;
124
+
109
125
  // Types pour les dépendances
110
126
  type EndpointApiCtor = { new(apiClient: ApiClient): EndpointApi };
111
127
  type EndpointApiDep = EndpointApi | EndpointApiCtor;
@@ -179,6 +195,9 @@ export type CostumContextFields = {
179
195
  costumSlug: string;
180
196
  contextId: string;
181
197
  contextType: EntityType;
198
+ // Aliases historiques lus en fallback côté backend (cf. SearchNew::getQueries).
199
+ costumId: string;
200
+ costumType: EntityType;
182
201
  sourceKey: string[];
183
202
  };
184
203
 
@@ -205,6 +224,12 @@ export type PaginatorState = {
205
224
  index: number;
206
225
  history: PaginationCursor[];
207
226
  sizes: number[];
227
+ /**
228
+ * Métadonnées libres survivant à la sérialisation JSON. Permet aux méthodes paginées
229
+ * de stocker des paramètres spécifiques (ex. `variant` pour `searchCostum`) qui doivent
230
+ * être restaurés lors d'un `restorePaginationFromJSON`.
231
+ */
232
+ meta?: Record<string, unknown>;
208
233
  };
209
234
 
210
235
  // PaginatorPage interface pour les résultats paginés
@@ -555,6 +580,28 @@ export class BaseEntity<TServerData = any> {
555
580
  return this.get();
556
581
  }
557
582
 
583
+ /**
584
+ * Helper pour les entités enfants : refresh automatique APRÈS une mutation directe
585
+ * (méthode appelée hors flow `save()`). Skip si l'appel vient de `save()` qui refresh
586
+ * lui-même à la fin — détecté via le flag `_calledFromSave`.
587
+ *
588
+ * À appeler dans les méthodes publiques de mutation (ex: `Action.cancel()`,
589
+ * `Organization.updateOpeningHours()`) après l'opération réussie, pour que le caller
590
+ * trouve `entity.serverData` à jour sans avoir à appeler `refresh()` manuellement.
591
+ *
592
+ * @example
593
+ * async myMutation(): Promise<unknown> {
594
+ * const result = await this.endpointApi.someEndpoint({ ... });
595
+ * await this._refreshIfDirect();
596
+ * return result;
597
+ * }
598
+ */
599
+ protected async _refreshIfDirect(): Promise<void> {
600
+ if (!this._calledFromSave && this.id) {
601
+ await this.refresh();
602
+ }
603
+ }
604
+
558
605
  /**
559
606
  * Sauvegarde les modifications locales vers le serveur (add ou update).
560
607
  * @returns Données serveur mises à jour (après éventuel `refresh()`)
@@ -2207,6 +2254,7 @@ export class BaseEntity<TServerData = any> {
2207
2254
  answers: ["id"],
2208
2255
  classifieds: ["id"],
2209
2256
  actions: ["id"],
2257
+ forms: ["id"],
2210
2258
  };
2211
2259
 
2212
2260
  const fetchKeys = (fetchKeysByEntity as Record<string, string[] | undefined>)[entityType];
@@ -3256,6 +3304,27 @@ export class BaseEntity<TServerData = any> {
3256
3304
  throw new ApiError(`action n'existe pas dans ${this.constructor.name}`, 501);
3257
3305
  }
3258
3306
 
3307
+ /**
3308
+ * Crée une instance de Form **dans le contexte costum de l'entité courante**.
3309
+ *
3310
+ * Méthode autorisée uniquement sur `Organization` et `Project` (les entités qui
3311
+ * portent un costumContext). Les autres entités la bloquent via un override
3312
+ * qui throw — cf. `User.form()`, `Event.form()`, `Poi.form()`, etc.
3313
+ *
3314
+ * @param formData - `{ id: string }` (Form n'a pas de slug)
3315
+ * @returns Le Form, déjà fetché (`get()` est appelé par `entity()` quand `id` est fourni).
3316
+ *
3317
+ * @example
3318
+ * const org = await api.organization({ slug: "navigatorDesTierslieux" });
3319
+ * const form = await org.form({ id: "6925e2b05dd63b02ca70d6d9" });
3320
+ * console.log(form.serverData.name); // "Coworking"
3321
+ * const answers = await form.getAnswers(); // utilise le costumContext de l'org
3322
+ */
3323
+ async form(formData: FormInput = {}): Promise<Form> {
3324
+ const entity = await this.entity("forms", formData);
3325
+ return entity as Form;
3326
+ }
3327
+
3259
3328
  /**
3260
3329
  * Récupérer les organisations d'une entitée : la liste des organisations dont l'entité est membre ou admin valide.
3261
3330
  * Constant : GET_ORGANIZATIONS_ADMIN | GET_ORGANIZATIONS_NO_ADMIN
@@ -4257,6 +4326,16 @@ export class BaseEntity<TServerData = any> {
4257
4326
 
4258
4327
  const hasStep = (d: PaginationCursor | null | undefined) => Boolean(d?.indexStep && d.indexStep > 0);
4259
4328
 
4329
+ // searchBy "actif" = truthy non-vide (cohérent avec `!empty($post["searchBy"])` côté PHP).
4330
+ // Couvre les 3 formes acceptées par le backend : "ALL", CSV ("name,slug"), array (["name", "slug"]).
4331
+ // Quand actif → pagination simple indexMin/indexMax (pas de ranges multi-collection).
4332
+ const isSearchByActive = (sb: unknown): boolean => {
4333
+ if (sb == null) return false;
4334
+ if (typeof sb === "string") return sb.length > 0;
4335
+ if (Array.isArray(sb)) return sb.length > 0;
4336
+ return false;
4337
+ };
4338
+
4260
4339
  async function getPage(isNext = false) {
4261
4340
  const data: PaginationCursor = { ...initialData };
4262
4341
 
@@ -4269,14 +4348,14 @@ export class BaseEntity<TServerData = any> {
4269
4348
  // hydrate data pour le premier appel
4270
4349
  data.countType = data.searchType;
4271
4350
 
4272
- if (!data.searchBy && hasStep(data)) {
4351
+ if (!isSearchByActive(data.searchBy) && hasStep(data)) {
4273
4352
  data.ranges = Entity._generateRanges(
4274
4353
  data.searchType as string[],
4275
4354
  data.indexStep as number
4276
4355
  );
4277
4356
  data.indexMin = data.indexMin ?? 0;
4278
4357
  data.indexMax = data.indexMax ?? data.indexStep;
4279
- } else if (data.searchBy === "ALL" && hasStep(data)) {
4358
+ } else if (isSearchByActive(data.searchBy) && hasStep(data)) {
4280
4359
  data.indexMin = data.indexMin ?? 0;
4281
4360
  data.indexMax = data.indexMax ?? data.indexStep;
4282
4361
  }
@@ -4289,7 +4368,7 @@ export class BaseEntity<TServerData = any> {
4289
4368
  if (isNext && cursor) {
4290
4369
  state.history.push({ ...cursor });
4291
4370
 
4292
- if (!cursor.searchBy && hasStep(cursor)) {
4371
+ if (!isSearchByActive(cursor.searchBy) && hasStep(cursor)) {
4293
4372
  cursor.ranges = Entity._generateRanges(
4294
4373
  cursor.searchType as string[],
4295
4374
  cursor.indexStep as number,
@@ -4297,7 +4376,7 @@ export class BaseEntity<TServerData = any> {
4297
4376
  );
4298
4377
  cursor.indexMin = cursor.indexMax ?? 0;
4299
4378
  cursor.indexMax = (cursor.indexMax ?? 0) + (cursor.indexStep as number);
4300
- } else if (cursor.searchBy === "ALL" && hasStep(cursor)) {
4379
+ } else if (isSearchByActive(cursor.searchBy) && hasStep(cursor)) {
4301
4380
  cursor.indexMin = cursor.indexMax ?? 0;
4302
4381
  cursor.indexMax = (cursor.indexMax ?? 0) + (cursor.indexStep as number);
4303
4382
  }
@@ -4388,6 +4467,10 @@ export class BaseEntity<TServerData = any> {
4388
4467
  costumSlug: sd.slug,
4389
4468
  contextId: sd.id,
4390
4469
  contextType: this.getEntityType(),
4470
+ // Aliases historiques lus en fallback par le backend (cf. SearchNew::getQueries) :
4471
+ // `$contextId = isset($post['contextId']) ? $post['contextId'] : $post['costumId']`
4472
+ costumId: sd.id,
4473
+ costumType: this.getEntityType(),
4391
4474
  sourceKey: [...inSourceKey, sd.slug] as string[]
4392
4475
  } as TIn & CostumContextFields;
4393
4476
 
@@ -4430,20 +4513,48 @@ export class BaseEntity<TServerData = any> {
4430
4513
  * const nextPage = await page.next();
4431
4514
  * console.log(nextPage.pageNumber, nextPage.results.length);
4432
4515
  * }
4516
+ *
4517
+ * @example
4518
+ * // Cibler l'endpoint navigator/gettl (mêmes paramètres et même format de réponse)
4519
+ * const page = await entity.searchCostum(
4520
+ * { name: "marseille", searchType: ["projects"] },
4521
+ * { variant: "navigator-tl" }
4522
+ * );
4433
4523
  */
4434
4524
  async searchCostum(
4435
4525
  data: Partial<GlobalAutocompleteCostumData> = {},
4436
- options?: { restoredState?: PaginatorState }
4526
+ options?: { restoredState?: PaginatorState; variant?: SearchCostumVariant }
4437
4527
  ): Promise<PaginatorPage<any>> {
4528
+ // Le variant peut être fourni explicitement OU restauré depuis le state d'une page sérialisée.
4529
+ // Ainsi `JSON.stringify(page) → restorePaginationFromJSON → next()` conserve l'endpoint cible.
4530
+ const restoredVariant = (options?.restoredState?.meta?.variant as SearchCostumVariant | undefined);
4531
+ const variant: SearchCostumVariant = options?.variant ?? restoredVariant ?? "default";
4532
+ const endpointMethod = SEARCH_COSTUM_ENDPOINTS[variant];
4533
+
4438
4534
  const paginator = this._createPaginatorEngine({
4439
4535
  initialData: data,
4536
+ // Toujours "searchCostum" (la vraie méthode) — sinon `restorePaginationFromJSON`
4537
+ // ne pourrait pas la retrouver via `entity[methodName]`. Le variant est persisté dans `state.meta`.
4440
4538
  methodName: "searchCostum",
4441
4539
  restoredState: options?.restoredState,
4442
4540
  finalizer: this._withCostumContext(
4443
- (finalData: GlobalAutocompleteCostumData) => this.endpointApi.globalAutocompleteCostum(finalData)
4541
+ (finalData: GlobalAutocompleteCostumData) => {
4542
+ // Les variants partagent le même schéma request/response côté backend
4543
+ // (cf. SEARCH_COSTUM_ENDPOINTS) — cast safe.
4544
+ const fn = this.endpointApi[endpointMethod] as typeof this.endpointApi.globalAutocompleteCostum;
4545
+ return fn.call(this.endpointApi, finalData);
4546
+ }
4444
4547
  ),
4445
4548
  });
4446
- return paginator.next() as Promise<PaginatorPage<any>>;
4549
+
4550
+ const page = await paginator.next() as PaginatorPage<any>;
4551
+
4552
+ // Persiste le variant dans le state pour qu'il survive à JSON.stringify/restore.
4553
+ if (page._state) {
4554
+ page._state.meta = { ...(page._state.meta || {}), variant };
4555
+ }
4556
+
4557
+ return page;
4447
4558
  }
4448
4559
 
4449
4560
  /**
@@ -157,6 +157,10 @@ export class Classified extends BaseEntity<ClassifiedItemNormalized> {
157
157
  throw new ApiError(`classified n'existe pas dans ${this.constructor.name}`, 501);
158
158
  }
159
159
 
160
+ override async form(): Promise<never> {
161
+ throw new ApiError(`form n'existe pas dans ${this.constructor.name}`, 501);
162
+ }
163
+
160
164
  override async follow(): Promise<never> {
161
165
  throw new ApiError(`follow n'existe pas dans ${this.constructor.name}`, 501);
162
166
  }
@@ -249,4 +249,7 @@ export class Comment extends BaseEntity<CommentItemNormalized> {
249
249
  return await this.callIsConnected(() => this.endpointApi.addReportAbuse(payload));
250
250
  }
251
251
 
252
+ override async form(): Promise<never> {
253
+ throw new ApiError(`form n'existe pas dans ${this.constructor.name}`, 501);
254
+ }
252
255
  }
@@ -2,7 +2,7 @@
2
2
  import { ApiAuthenticationError } from "../error.js";
3
3
 
4
4
  import type ApiClient from "../ApiClient.js";
5
- import type { PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, GetNewsData, GetNewsByIdData, AddNewsData, AddImageNewsData, AddFileNewsData, DeleteNewsData, UpdateNewsData, ShareNewsData, GetCommentsData, AddCommentsData, DeleteCommentsData, UpdateCommentsData, SearchTagsData, ShowVoteData, GlobalAutocompleteData, CityAutocompleteData, CityAutocompleteByCountryData, SuggestionInputData, GetProjectsNoAdminData, GetProjectsAdminData, GetPoisNoAdminData, GetPoisAdminData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeletePoiData, DeleteEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, ShareEventsData, InviteEventData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, CoformGetAnswerFilesData, SaveCoformAnswerData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData } from "./EndpointApi.types.js";
5
+ import type { PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, GetNewsData, GetNewsByIdData, AddNewsData, AddImageNewsData, AddFileNewsData, DeleteNewsData, UpdateNewsData, ShareNewsData, GetCommentsData, AddCommentsData, DeleteCommentsData, UpdateCommentsData, SearchTagsData, ShowVoteData, GlobalAutocompleteData, CityAutocompleteData, CityAutocompleteByCountryData, SuggestionInputData, GetProjectsNoAdminData, GetProjectsAdminData, GetPoisNoAdminData, GetPoisAdminData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeletePoiData, DeleteEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, ShareEventsData, InviteEventData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, CoformGetAnswerFilesData, SaveCoformAnswerData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData } from "./EndpointApi.types.js";
6
6
 
7
7
  /**
8
8
  * Classe EndpointApi générée automatiquement depuis endpoints-copie.json
@@ -1444,6 +1444,21 @@ export class EndpointApi {
1444
1444
  return this.call("GLOBAL_AUTOCOMPLETE_COSTUM", data);
1445
1445
  }
1446
1446
 
1447
+ /**
1448
+ * Navigator timeline (alias de globalautocomplete) : Recherche globale via navigator/gettl — schémas request/response identiques à GLOBAL_AUTOCOMPLETE_COSTUM
1449
+ * Constant : NAVIGATOR_GETTL
1450
+ * @param data - Données envoyées à l'API
1451
+ * @returns Les données de réponse.
1452
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1453
+ * @throws {Error} - En cas d'erreur inattendue.
1454
+ */
1455
+ async navigatorGettl(data: NavigatorGettlData): Promise<any> {
1456
+ if (!data || typeof data !== "object") {
1457
+ throw new TypeError("Le paramètre data doit être un objet.");
1458
+ }
1459
+ return this.call("NAVIGATOR_GETTL", data);
1460
+ }
1461
+
1447
1462
  /**
1448
1463
  * Récupérer les acteurs d'événement : Récupérer les acteurs (organizers, attendees, creators, animators) d'une entité événement.
1449
1464
  * Constant : COSTUM_EVENT_REQUEST_ACTORS
@@ -1920,6 +1935,86 @@ export class EndpointApi {
1920
1935
  return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_NEW", data);
1921
1936
  }
1922
1937
 
1938
+ /**
1939
+ * Change le statut d'une action (avec logique métier) : Change le status d'une action via l'endpoint dédié backend. Ajoute une entrée à updateStatus[], gère les tags (discuter/totest/next), auto-injecte startDate/endDate selon le status, gère tracking, envoie une notification Rocket.Chat au parent. NE PAS confondre avec UPDATE_PATH_VALUE qui bypass toute cette logique.
1940
+ * Constant : COSTUM_PROJECT_ACTION_REQUEST_SET_STATUS
1941
+ * @param data - Données envoyées à l'API
1942
+ * @returns Les données de réponse.
1943
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1944
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1945
+ * @throws {Error} - En cas d'erreur inattendue.
1946
+ */
1947
+ async costumProjectActionRequestSetStatus(data: CostumProjectActionRequestSetStatusData): Promise<any> {
1948
+ if (!data || typeof data !== "object") {
1949
+ throw new TypeError("Le paramètre data doit être un objet.");
1950
+ }
1951
+ return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_STATUS", data);
1952
+ }
1953
+
1954
+ /**
1955
+ * Met à jour les dates d'une action : Met à jour startDate et/ou endDate d'une action via l'endpoint dédié. Supporte nativement l'effacement (envoyer chaîne vide → $unset). Parser de date robuste côté backend.
1956
+ * Constant : COSTUM_PROJECT_ACTION_REQUEST_SET_DATE
1957
+ * @param data - Données envoyées à l'API
1958
+ * @returns Les données de réponse.
1959
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1960
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1961
+ * @throws {Error} - En cas d'erreur inattendue.
1962
+ */
1963
+ async costumProjectActionRequestSetDate(data: CostumProjectActionRequestSetDateData): Promise<any> {
1964
+ if (!data || typeof data !== "object") {
1965
+ throw new TypeError("Le paramètre data doit être un objet.");
1966
+ }
1967
+ return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_DATE", data);
1968
+ }
1969
+
1970
+ /**
1971
+ * Définit les contributeurs d'une action : Modifie links.contributors d'une action via 3 modes : (A) `contributors` array de userIds = remplace toute la liste ; (B) `contributor` + `participate=1` = ajoute un user ; (C) `contributor` + `participate=0` = retire un user. Valide les bornes `min`/`max` côté backend. Émet `.set-contributors{parentId}` et `.cd-int-contributors` aux clients socket.
1972
+ * Constant : COSTUM_PROJECT_ACTION_REQUEST_SET_CONTRIBUTORS
1973
+ * @param data - Données envoyées à l'API
1974
+ * @returns Les données de réponse.
1975
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1976
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1977
+ * @throws {Error} - En cas d'erreur inattendue.
1978
+ */
1979
+ async costumProjectActionRequestSetContributors(data: CostumProjectActionRequestSetContributorsData): Promise<any> {
1980
+ if (!data || typeof data !== "object") {
1981
+ throw new TypeError("Le paramètre data doit être un objet.");
1982
+ }
1983
+ return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_CONTRIBUTORS", data);
1984
+ }
1985
+
1986
+ /**
1987
+ * Annule une action : Annule une action : status=closed + unset tracking + retire le tag 'totest'.
1988
+ * Constant : COSTUM_PROJECT_ACTION_REQUEST_CANCEL
1989
+ * @param data - Données envoyées à l'API
1990
+ * @returns Les données de réponse.
1991
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1992
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1993
+ * @throws {Error} - En cas d'erreur inattendue.
1994
+ */
1995
+ async costumProjectActionRequestCancel(data: CostumProjectActionRequestCancelData): Promise<any> {
1996
+ if (!data || typeof data !== "object") {
1997
+ throw new TypeError("Le paramètre data doit être un objet.");
1998
+ }
1999
+ return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_CANCEL", data);
2000
+ }
2001
+
2002
+ /**
2003
+ * Archive une action : Archive une action : status=disabled + unset tracking.
2004
+ * Constant : COSTUM_PROJECT_ACTION_REQUEST_ARCHIVE
2005
+ * @param data - Données envoyées à l'API
2006
+ * @returns Les données de réponse.
2007
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
2008
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
2009
+ * @throws {Error} - En cas d'erreur inattendue.
2010
+ */
2011
+ async costumProjectActionRequestArchive(data: CostumProjectActionRequestArchiveData): Promise<any> {
2012
+ if (!data || typeof data !== "object") {
2013
+ throw new TypeError("Le paramètre data doit être un objet.");
2014
+ }
2015
+ return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_ARCHIVE", data);
2016
+ }
2017
+
1923
2018
  /**
1924
2019
  * Interoperabilité Discourse Lié un compte : Lier un compte Discourse
1925
2020
  * Constant : LINK_DISCOURSE_ACCOUNT