@communecter/cocolight-api-client 1.0.166 → 1.0.168
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 +1 -1
- package/dist/cocolight-api-client.cjs +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/types/api/BaseEntity.d.ts +77 -0
- package/types/api/EndpointApi.d.ts +11 -1
- package/types/api/EndpointApi.types.d.ts +110 -8
- package/types/costum/runtime.d.ts +19 -5
- package/types/endpoints.module.d.ts +876 -413
package/package.json
CHANGED
|
@@ -183,6 +183,21 @@ export type CostumContextFields = {
|
|
|
183
183
|
sourceKey: string[];
|
|
184
184
|
};
|
|
185
185
|
export type WithCostumContext<T> = T & CostumContextFields;
|
|
186
|
+
/**
|
|
187
|
+
* Exclut les items de FIL (`activityStream`/`activitypub`) d'une recherche `searchType: news`.
|
|
188
|
+
*
|
|
189
|
+
* Invariant de « news éditoriale » : la collection `news` contient AUSSI des items auto-générés
|
|
190
|
+
* ("X a créé Y") que `globalautocomplete` remonte bruts ; un `searchType: ["news"]` veut dire ACTUALITÉS,
|
|
191
|
+
* pour TOUT consommateur. Filtre posé au niveau REQUÊTE → honoré à l'identique par le legacy ET le backend
|
|
192
|
+
* Node (`buildFilters`) → byte-parité préservée. Cohérent avec `getNews` (mur profil, exclut déjà activityStream).
|
|
193
|
+
*
|
|
194
|
+
* NO-OP si `news` absent des types, OU si un filtre `type` explicite est déjà posé (OVERRIDABLE :
|
|
195
|
+
* un outil de modération voulant le fil brut passe son propre `filters.type`).
|
|
196
|
+
*/
|
|
197
|
+
export declare function withNewsActivityExclusion<T extends {
|
|
198
|
+
searchType?: string[];
|
|
199
|
+
filters?: unknown;
|
|
200
|
+
}>(data: T): T;
|
|
186
201
|
/**
|
|
187
202
|
* Bornes d'agenda acceptant un `Date` (coercé en ISO par la méthode avant l'envoi — le fil reste
|
|
188
203
|
* `type:string`). Partagé par `searchEventsCostum` et `getEvents`.
|
|
@@ -708,6 +723,48 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
708
723
|
* await news.deleteFile(imageDocId);
|
|
709
724
|
*/
|
|
710
725
|
deleteFile(docId: string): Promise<void>;
|
|
726
|
+
/**
|
|
727
|
+
* Champs de contexte costum à joindre à un upload multipart (profil/bannière/galerie) pour que le
|
|
728
|
+
* backend stampe `source.key` (Document.php:228-232). Dérivés de `_costumCtx` (résolu du `source.key`
|
|
729
|
+
* de l'élément) → un POI scopé "parent62" envoie `costumSlug="parent62"`. `{}` hors contexte costum.
|
|
730
|
+
*/
|
|
731
|
+
protected _costumUploadFields(): {
|
|
732
|
+
costumSlug?: string;
|
|
733
|
+
costumId?: string;
|
|
734
|
+
costumType?: string;
|
|
735
|
+
};
|
|
736
|
+
/**
|
|
737
|
+
* Uploade un document (image/fichier) rattaché à CET élément, avec `contentKey`/`docType`
|
|
738
|
+
* PARAMÉTRABLES — ex. `contentKey:"slider"` pour une galerie (Option C). La provenance costum
|
|
739
|
+
* (`source.key`) est injectée automatiquement depuis `_costumCtx` (résolu du `source.key` de
|
|
740
|
+
* l'élément). L'élément DOIT préexister (pas d'auto-création, contraste avec `Answer.uploadFile`).
|
|
741
|
+
* Endpoint générique `UPLOAD_DOCUMENT` (backend `co2/document/upload-save`, route wildcard).
|
|
742
|
+
*
|
|
743
|
+
* STATELESS : ne rafraîchit PAS `serverData` (pas de push local façon `News.addImage`). Pour refléter
|
|
744
|
+
* la nouvelle image dans `getGalleryImages()`, re-fetch l'élément via `about` après upload (le
|
|
745
|
+
* consommateur peut afficher optimistement via le `docPath` retourné en attendant). Cf. patron
|
|
746
|
+
* `Answer.processUploads` : la galerie s'uploade APRÈS `save()` (l'élément doit avoir un `id`).
|
|
747
|
+
*
|
|
748
|
+
* @returns `{ docId, docPath }` — id du document créé + URL relative servie.
|
|
749
|
+
* @throws {ApiError} 404 si l'entité n'est pas enregistrée (pas d'`id`).
|
|
750
|
+
*/
|
|
751
|
+
uploadDocument(file: UploadInput, opts: {
|
|
752
|
+
contentKey: string;
|
|
753
|
+
docType?: "image" | "file";
|
|
754
|
+
subKey?: string;
|
|
755
|
+
folder?: string;
|
|
756
|
+
ownerId?: string;
|
|
757
|
+
}): Promise<{
|
|
758
|
+
docId: string;
|
|
759
|
+
docPath: string;
|
|
760
|
+
}>;
|
|
761
|
+
/**
|
|
762
|
+
* Images d'une galerie de CET élément, lues depuis le champ `images` fusionné par `about`/getById
|
|
763
|
+
* (backend `enrichAbout` — {Poi,Classified}::getById), filtrées par `contentKey` (défaut `"slider"`).
|
|
764
|
+
* SYNCHRONE : nécessite que l'entité ait été chargée via `about` (sinon `[]`). Forme = getListOfImage
|
|
765
|
+
* (`{ id, _id, contentKey, imagePath, imageThumbPath, imageMediumPath, subKey, name, ... }`).
|
|
766
|
+
*/
|
|
767
|
+
getGalleryImages(contentKey?: string): Array<Record<string, unknown>>;
|
|
711
768
|
/**
|
|
712
769
|
* Liste les documents (images/fichiers) attachés à CETTE entité (`id` + `type`) via `DOCUMENT_LIST`
|
|
713
770
|
* (port legacy `document/list`). Renvoie un tableau plat `{ id, name, path, author, contentKey }`.
|
|
@@ -721,6 +778,26 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
721
778
|
author?: string;
|
|
722
779
|
contentKey?: string;
|
|
723
780
|
}>>;
|
|
781
|
+
/**
|
|
782
|
+
* Liste les FICHIERS (documents non-image, `doctype:"file"`) attachés à CETTE entité via `GET_GALLERY`
|
|
783
|
+
* (`co2/gallery/index`, branche fichier : `docs` = OBJET keyé par `_id`, records BRUTS + `docPath`
|
|
784
|
+
* absolutisé par `_imageFields`). Source UNIQUE et uniforme tous types (org/projet/citoyen/poi/events/
|
|
785
|
+
* classifieds — l'`IndexAction` legacy est type-agnostique). Contraste `getGalleryImages` (images,
|
|
786
|
+
* synchrone via `about`) et `getDocuments` (DOCUMENT_LIST, forme réduite sans `size`/`docType`, `path`
|
|
787
|
+
* = dossier seul). Les fichiers rangés en dossier (`folderId`) sont exclus par défaut (parité
|
|
788
|
+
* `IndexAction` : `folderId:{$exists:false}`).
|
|
789
|
+
*
|
|
790
|
+
* @returns `{ docId, docPath, name, size, contentKey }[]` — `contentKey` = valeur DÉRIVÉE stockée
|
|
791
|
+
* (`pdf`/`spreadsheet`/`text`/`presentation`), utilisable pour choisir l'icône.
|
|
792
|
+
* @throws {ApiError} 404 si l'entité n'est pas enregistrée.
|
|
793
|
+
*/
|
|
794
|
+
getGalleryFiles(): Promise<Array<{
|
|
795
|
+
docId: string;
|
|
796
|
+
docPath?: string;
|
|
797
|
+
name?: string;
|
|
798
|
+
size?: number;
|
|
799
|
+
contentKey?: string;
|
|
800
|
+
}>>;
|
|
724
801
|
/**
|
|
725
802
|
* Supprime l'image de PROFIL de cette entité : récupère le `docId` du document `contentKey:"profil"`
|
|
726
803
|
* (via `getDocuments`) puis `deleteFile`. No-op (`false`) s'il n'y a pas d'image. Pendant exact de
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ApiClient from "../ApiClient.js";
|
|
2
|
-
import type { DocumentListData, 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, GlobalAutocompleteAdminCostumData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetUserEligiblePlacesData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, SearchEventsCostumData, ShareEventsData, InviteMembersData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, DeleteCoformAnswerFileData, CoformGetAnswerFilesData, GetCoformCatalogsData, SaveCoformAnswerData, GetCoformAnswerHistoryData, GetCoformMultievalDataData, GetCoformCommontableContributorsData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData, PersonActivateData, ImportPreviewData, ExportElementsData, ImportElementsData, GeocodageData, ValidateGroupData, SetSourceData, ModerateData, NewsModerateData, CommentModerateData } from "./EndpointApi.types.js";
|
|
2
|
+
import type { DocumentListData, 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, GlobalAutocompleteAdminCostumData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetUserEligiblePlacesData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, SearchEventsCostumData, ShareEventsData, InviteMembersData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, DeleteCoformAnswerFileData, CoformGetAnswerFilesData, GetCoformCatalogsData, SaveCoformAnswerData, GetCoformAnswerHistoryData, GetCoformMultievalDataData, GetCoformCommontableContributorsData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData, PersonActivateData, ImportPreviewData, ExportElementsData, ImportElementsData, GeocodageData, ValidateGroupData, SetSourceData, ModerateData, NewsModerateData, CommentModerateData, UploadDocumentData } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -1502,5 +1502,15 @@ export declare class EndpointApi {
|
|
|
1502
1502
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1503
1503
|
*/
|
|
1504
1504
|
commentModerate(data: CommentModerateData): Promise<any>;
|
|
1505
|
+
/**
|
|
1506
|
+
* Uploader un document/image sur un élément (galerie) : Uploade un document (image/fichier) rattaché à un ÉLÉMENT, avec docType/contentKey PARAMÉTRABLES (ex. contentKey=slider pour une galerie) et provenance costum optionnelle (costumSlug/costumId/costumType stampent source.key). Backend: co2/document/upload-save (route wildcard, parseKv). L'élément doit préexister.
|
|
1507
|
+
* Constant : UPLOAD_DOCUMENT
|
|
1508
|
+
* @param data - Données envoyées à l'API
|
|
1509
|
+
* @returns Les données de réponse.
|
|
1510
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1511
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1512
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1513
|
+
*/
|
|
1514
|
+
uploadDocument(data: UploadDocumentData): Promise<any>;
|
|
1505
1515
|
}
|
|
1506
1516
|
export default EndpointApi;
|
|
@@ -364,6 +364,18 @@ export interface ProfilImageData {
|
|
|
364
364
|
profil_avatar: {
|
|
365
365
|
[k: string]: unknown;
|
|
366
366
|
};
|
|
367
|
+
/**
|
|
368
|
+
* Slug du costum actif (stampe source.key côté backend) — optionnel
|
|
369
|
+
*/
|
|
370
|
+
costumSlug?: string;
|
|
371
|
+
/**
|
|
372
|
+
* ID du contexte costum — optionnel
|
|
373
|
+
*/
|
|
374
|
+
costumId?: string;
|
|
375
|
+
/**
|
|
376
|
+
* Type (collection) du contexte costum — optionnel
|
|
377
|
+
*/
|
|
378
|
+
costumType?: string;
|
|
367
379
|
pathParams?: {
|
|
368
380
|
/**
|
|
369
381
|
* Type d'entité
|
|
@@ -391,6 +403,18 @@ export interface ProfilBannerData {
|
|
|
391
403
|
cropH: number;
|
|
392
404
|
cropX: number;
|
|
393
405
|
cropY: number;
|
|
406
|
+
/**
|
|
407
|
+
* Slug du costum actif (stampe source.key côté backend) — optionnel
|
|
408
|
+
*/
|
|
409
|
+
costumSlug?: string;
|
|
410
|
+
/**
|
|
411
|
+
* ID du contexte costum — optionnel
|
|
412
|
+
*/
|
|
413
|
+
costumId?: string;
|
|
414
|
+
/**
|
|
415
|
+
* Type (collection) du contexte costum — optionnel
|
|
416
|
+
*/
|
|
417
|
+
costumType?: string;
|
|
394
418
|
pathParams?: {
|
|
395
419
|
/**
|
|
396
420
|
* Type d'entité
|
|
@@ -522,6 +546,24 @@ export interface AddNewsData {
|
|
|
522
546
|
* Indique que la réponse est au format JSON.
|
|
523
547
|
*/
|
|
524
548
|
json: true;
|
|
549
|
+
/**
|
|
550
|
+
* Optionnel. Provenance costum (estampille source.key côté backend, cf. News::prepData). Injecté par le scope costum de la lib (me.costum(...).news()) depuis le _costumCtx — l'appelant n'a normalement pas à le fournir. Format canonique {insertOrign, key, keys} (cf. Element.php + données réelles).
|
|
551
|
+
*/
|
|
552
|
+
source?: {
|
|
553
|
+
/**
|
|
554
|
+
* Origine de la source (ex: 'costum'). Faute de frappe historique conservée (fait FOI).
|
|
555
|
+
*/
|
|
556
|
+
insertOrign?: string;
|
|
557
|
+
/**
|
|
558
|
+
* Slug du costum (= source.key).
|
|
559
|
+
*/
|
|
560
|
+
key?: string;
|
|
561
|
+
/**
|
|
562
|
+
* Slugs de costum (= source.keys).
|
|
563
|
+
*/
|
|
564
|
+
keys?: string[];
|
|
565
|
+
[k: string]: unknown;
|
|
566
|
+
};
|
|
525
567
|
/**
|
|
526
568
|
* Tags : "" pour effacer tous les tags, ou tableau de mots-clés.
|
|
527
569
|
*/
|
|
@@ -1414,7 +1456,7 @@ export interface GlobalAutocompleteAdminCostumData {
|
|
|
1414
1456
|
/**
|
|
1415
1457
|
* Types d'entités à inclure dans la recherche
|
|
1416
1458
|
*/
|
|
1417
|
-
searchType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "answers" | "forms" | "classifieds")[];
|
|
1459
|
+
searchType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "news" | "answers" | "forms" | "classifieds")[];
|
|
1418
1460
|
/**
|
|
1419
1461
|
* Balises (tags) à utiliser pour filtrer la recherche
|
|
1420
1462
|
*/
|
|
@@ -1422,7 +1464,7 @@ export interface GlobalAutocompleteAdminCostumData {
|
|
|
1422
1464
|
/**
|
|
1423
1465
|
* Liste fixe des types à compter dans les résultats
|
|
1424
1466
|
*/
|
|
1425
|
-
countType?: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "answers" | "forms" | "classifieds")[];
|
|
1467
|
+
countType?: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "news" | "answers" | "forms" | "classifieds")[];
|
|
1426
1468
|
/**
|
|
1427
1469
|
* Sélecteur des champs où chercher le terme `name`. Trois formes acceptées : `"ALL"` (cherche dans name/title/slug/tags/source.keys/sigle/description), chaîne CSV (`"name,slug,tags"`), ou tableau de chemins (`["name", "address.addressLocality"]`).
|
|
1428
1470
|
*/
|
|
@@ -3190,6 +3232,18 @@ export interface AddPoiData {
|
|
|
3190
3232
|
*/
|
|
3191
3233
|
description?: string;
|
|
3192
3234
|
tags?: "" | string[];
|
|
3235
|
+
/**
|
|
3236
|
+
* Médias attachés au POI (audio/vidéo…) : [{type, url, …}]. Champ natif du dataBinding POI (Poi.php:64), absent du contrat curé jusqu'ici. Permissif (items objet libre).
|
|
3237
|
+
*/
|
|
3238
|
+
medias?: {
|
|
3239
|
+
[k: string]: unknown;
|
|
3240
|
+
}[];
|
|
3241
|
+
/**
|
|
3242
|
+
* Préférences de l'élément (drapeaux legacy : toBeValidated = modération a priori costum {slug:true}, isOpenEdition…). Objet libre, normalisé côté backend (Element::prepData → Costum::prepData).
|
|
3243
|
+
*/
|
|
3244
|
+
preferences?: {
|
|
3245
|
+
[k: string]: unknown;
|
|
3246
|
+
};
|
|
3193
3247
|
/**
|
|
3194
3248
|
* URLs externes associées
|
|
3195
3249
|
*/
|
|
@@ -4156,7 +4210,7 @@ export interface GlobalAutocompleteCostumData {
|
|
|
4156
4210
|
/**
|
|
4157
4211
|
* Types d'entités à inclure dans la recherche
|
|
4158
4212
|
*/
|
|
4159
|
-
searchType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "answers" | "forms" | "classifieds")[];
|
|
4213
|
+
searchType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "news" | "answers" | "forms" | "classifieds")[];
|
|
4160
4214
|
/**
|
|
4161
4215
|
* Balises (tags) à utiliser pour filtrer la recherche
|
|
4162
4216
|
*/
|
|
@@ -4164,7 +4218,7 @@ export interface GlobalAutocompleteCostumData {
|
|
|
4164
4218
|
/**
|
|
4165
4219
|
* Liste fixe des types à compter dans les résultats
|
|
4166
4220
|
*/
|
|
4167
|
-
countType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "answers" | "forms" | "classifieds")[];
|
|
4221
|
+
countType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "news" | "answers" | "forms" | "classifieds")[];
|
|
4168
4222
|
/**
|
|
4169
4223
|
* Sélecteur des champs où chercher le terme `name`. Trois formes acceptées : `"ALL"` (cherche dans name/title/slug/tags/source.keys/sigle/description), chaîne CSV (`"name,slug,tags"`), ou tableau de chemins (`["name", "address.addressLocality"]`).
|
|
4170
4224
|
*/
|
|
@@ -4318,7 +4372,7 @@ export interface NavigatorGettlData {
|
|
|
4318
4372
|
/**
|
|
4319
4373
|
* Types d'entités à inclure dans la recherche
|
|
4320
4374
|
*/
|
|
4321
|
-
searchType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "answers" | "forms" | "classifieds")[];
|
|
4375
|
+
searchType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "news" | "answers" | "forms" | "classifieds")[];
|
|
4322
4376
|
/**
|
|
4323
4377
|
* Balises (tags) à utiliser pour filtrer la recherche
|
|
4324
4378
|
*/
|
|
@@ -4326,7 +4380,7 @@ export interface NavigatorGettlData {
|
|
|
4326
4380
|
/**
|
|
4327
4381
|
* Liste fixe des types à compter dans les résultats
|
|
4328
4382
|
*/
|
|
4329
|
-
countType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "answers" | "forms" | "classifieds")[];
|
|
4383
|
+
countType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "news" | "answers" | "forms" | "classifieds")[];
|
|
4330
4384
|
/**
|
|
4331
4385
|
* Sélecteur des champs où chercher le terme `name`. Trois formes acceptées : `"ALL"` (cherche dans name/title/slug/tags/source.keys/sigle/description), chaîne CSV (`"name,slug,tags"`), ou tableau de chemins (`["name", "address.addressLocality"]`).
|
|
4332
4386
|
*/
|
|
@@ -4912,9 +4966,9 @@ export interface GetGalleryData {
|
|
|
4912
4966
|
*/
|
|
4913
4967
|
id: string;
|
|
4914
4968
|
/**
|
|
4915
|
-
* Type d'entité
|
|
4969
|
+
* Type d'entité (IndexAction legacy est type-agnostique ; poi/events/classifieds ajoutés pour la lecture des documents/fichiers via getGalleryFiles)
|
|
4916
4970
|
*/
|
|
4917
|
-
type: "citoyens" | "organizations" | "projects";
|
|
4971
|
+
type: "citoyens" | "organizations" | "projects" | "poi" | "events" | "classifieds";
|
|
4918
4972
|
/**
|
|
4919
4973
|
* Type de document
|
|
4920
4974
|
*/
|
|
@@ -6348,3 +6402,51 @@ export interface CommentModerateData {
|
|
|
6348
6402
|
isAnAbuse?: "true" | "false";
|
|
6349
6403
|
[k: string]: unknown;
|
|
6350
6404
|
}
|
|
6405
|
+
export interface UploadDocumentData {
|
|
6406
|
+
/**
|
|
6407
|
+
* Fichier à uploader
|
|
6408
|
+
*/
|
|
6409
|
+
qqfile: {
|
|
6410
|
+
[k: string]: unknown;
|
|
6411
|
+
};
|
|
6412
|
+
/**
|
|
6413
|
+
* Slug du costum actif (stampe source.key=costumSlug)
|
|
6414
|
+
*/
|
|
6415
|
+
costumSlug?: string;
|
|
6416
|
+
/**
|
|
6417
|
+
* ID du contexte costum
|
|
6418
|
+
*/
|
|
6419
|
+
costumId?: string;
|
|
6420
|
+
/**
|
|
6421
|
+
* Type (collection) du contexte costum
|
|
6422
|
+
*/
|
|
6423
|
+
costumType?: string;
|
|
6424
|
+
/**
|
|
6425
|
+
* Sous-clé de galerie (optionnelle)
|
|
6426
|
+
*/
|
|
6427
|
+
subKey?: string;
|
|
6428
|
+
/**
|
|
6429
|
+
* Dossier d'album cible (optionnel)
|
|
6430
|
+
*/
|
|
6431
|
+
folderId?: string;
|
|
6432
|
+
pathParams?: {
|
|
6433
|
+
/**
|
|
6434
|
+
* Type (collection) de l'élément porteur
|
|
6435
|
+
*/
|
|
6436
|
+
folder: "citoyens" | "projects" | "organizations" | "events" | "poi" | "classifieds";
|
|
6437
|
+
/**
|
|
6438
|
+
* ID de l'élément porteur (doit exister)
|
|
6439
|
+
*/
|
|
6440
|
+
ownerId: string;
|
|
6441
|
+
/**
|
|
6442
|
+
* Nature du document
|
|
6443
|
+
*/
|
|
6444
|
+
docType: "image" | "file";
|
|
6445
|
+
/**
|
|
6446
|
+
* Clé de contenu (ex: 'slider' pour galerie, 'file', 'profil', 'banner'...)
|
|
6447
|
+
*/
|
|
6448
|
+
contentKey: string;
|
|
6449
|
+
[k: string]: unknown;
|
|
6450
|
+
};
|
|
6451
|
+
[k: string]: unknown;
|
|
6452
|
+
}
|
|
@@ -102,6 +102,14 @@ export declare class CostumScope {
|
|
|
102
102
|
organization(data?: Record<string, unknown>): Promise<import("../index.js").Organization>;
|
|
103
103
|
project(data?: Record<string, unknown>): Promise<import("../index.js").Project>;
|
|
104
104
|
event(data?: Record<string, unknown>): Promise<import("../index.js").Event>;
|
|
105
|
+
/**
|
|
106
|
+
* Poste une news sous CE costum, sur le mur de `target` : `source.key` = costum du scope (le SITE,
|
|
107
|
+
* comme poi/org — cf. `News::prepData`), `parent` = `target`. News n'est PAS une collection « élément »
|
|
108
|
+
* (pas d'`element/save` ni de champs costum) : on la crée via `target.entity("news", …, {costumCtx})`.
|
|
109
|
+
* Le `costumCtx` EXPLICITE court-circuite l'héritage parent d'`entity()` → la source vient du SITE,
|
|
110
|
+
* jamais du mur. `News._add` lit ce `_costumCtx` et estampille `source` (pendant des uploads costum).
|
|
111
|
+
*/
|
|
112
|
+
news(target: BaseEntity, data?: Record<string, unknown>): Promise<import("../index.js").News>;
|
|
105
113
|
/**
|
|
106
114
|
* Décrit le FORMULAIRE costum d'une collection (null si non couverte) — projection NEUTRE des
|
|
107
115
|
* métadonnées runtime (champs typés + enum/multiple, presets, hidden, add, createLabel). Le module
|
|
@@ -121,12 +129,18 @@ export declare class CostumScope {
|
|
|
121
129
|
*/
|
|
122
130
|
export declare function resolveCostumCtxFromSource(sourceKey: string | undefined | null, collection: Collection, type?: string | null): CostumRuntimeContext | null;
|
|
123
131
|
/**
|
|
124
|
-
* Ouvre un scope costum
|
|
125
|
-
* l'entité (= `source.key` posé par le backend), `costumId/costumType` = l'entité porteuse.
|
|
126
|
-
*
|
|
127
|
-
*
|
|
132
|
+
* Ouvre un scope costum depuis une entité DÉJÀ CHARGÉE (org/projet/event porteur d'un costum) : `costumSlug`
|
|
133
|
+
* = slug de l'entité (= `source.key` posé par le backend), `costumId/costumType` = l'entité porteuse. C'est
|
|
134
|
+
* la voie AMBIANTE (« costum du déploiement ») de `me.costum(entity)`.
|
|
135
|
+
*
|
|
136
|
+
* Le scope porte les DÉFINITIONS du costum (champs + presets de sous-type, ex. `type:"article"`), PAS
|
|
137
|
+
* seulement l'identité : sinon un CREATE de sous-type sous l'ambiant perd le `type` forcé → rejet enum ADD_*.
|
|
138
|
+
* Résolution (dégradée, jamais throw) : 1) cache live frais (zéro fetch — le costum est déjà chargé au rendu
|
|
139
|
+
* du site) ; 2) digest live `getcostumjson` (comble presets/champs + peuple le cache) ; 3) fieldless
|
|
140
|
+
* (identité seule — site nu sans costum, ou offline = comportement historique). Le backend re-gate `found`
|
|
141
|
+
* sur l'existence d'un costum → un site sans costum n'estampille rien.
|
|
128
142
|
*/
|
|
129
|
-
export declare function costumScopeFromEntity(user: BaseEntity, entity: BaseEntity): CostumScope
|
|
143
|
+
export declare function costumScopeFromEntity(user: BaseEntity, entity: BaseEntity): Promise<CostumScope>;
|
|
130
144
|
/**
|
|
131
145
|
* Résout un `CostumScope` par SLUG pour un user connecté.
|
|
132
146
|
* - slug à champs (meta + loader) → charge le module généré (code-split via dynamic import).
|