@communecter/cocolight-api-client 1.0.160 → 1.0.161
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 +5 -1
- package/types/api/EndpointApi.d.ts +11 -1
- package/types/api/EndpointApi.types.d.ts +183 -0
- package/types/endpoints.module.d.ts +1446 -843
package/package.json
CHANGED
|
@@ -71,8 +71,12 @@ type ParentLike = BaseEntity<any> & {
|
|
|
71
71
|
*
|
|
72
72
|
* - `default` → `/co2/search/globalautocomplete`
|
|
73
73
|
* - `navigator-tl` → `/costum/navigator/gettl`
|
|
74
|
+
* - `admin` → `/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true`
|
|
75
|
+
* (SearchNew::searchAdmin — réservé aux admins de l'entité porteuse : `fields` = projection
|
|
76
|
+
* EXACTE, `preferences` NON strippé → badge/filtre `toBeValidated`, tri serveur via `sort`.
|
|
77
|
+
* pathParams {type,id} posés automatiquement depuis l'entité appelante — cf. searchCostum.)
|
|
74
78
|
*/
|
|
75
|
-
export type SearchCostumVariant = "default" | "navigator-tl";
|
|
79
|
+
export type SearchCostumVariant = "default" | "navigator-tl" | "admin";
|
|
76
80
|
/**
|
|
77
81
|
* Types de coercion backend supportés par `UPDATE_PATH_VALUE.setType`.
|
|
78
82
|
*
|
|
@@ -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, 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 } 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 } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -449,6 +449,16 @@ export declare class EndpointApi {
|
|
|
449
449
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
450
450
|
*/
|
|
451
451
|
getPoisAdmin(data: GetPoisAdminData): Promise<any>;
|
|
452
|
+
/**
|
|
453
|
+
* Recherche globale ADMIN (scopée costum) : Variante ADMIN générique de la recherche costum (SearchNew::searchAdmin). {type}/{id} = l'élément CONTEXTE de droits (l'hôte du costum) : accès si super-admin OU admin de cet élément, sinon 200 {results:[]} (gate silencieuse legacy). Contrairement au public : `fields` = projection EXACTE (documents complets moins pwd si absent), `preferences` NON strippé (badge/filtre toBeValidated), pagination non plafonnée. Sert le variant `admin` de searchCostum (tables d'administration : recherche, tri serveur, statut de validation).
|
|
454
|
+
* Constant : GLOBAL_AUTOCOMPLETE_ADMIN_COSTUM
|
|
455
|
+
* @param data - Données envoyées à l'API
|
|
456
|
+
* @returns Les données de réponse.
|
|
457
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
458
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
459
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
460
|
+
*/
|
|
461
|
+
globalAutocompleteAdminCostum(data: GlobalAutocompleteAdminCostumData): Promise<any>;
|
|
452
462
|
/**
|
|
453
463
|
* Récupérer les organisations non administrables : Récupère la liste des organisations auxquelles l’utilisateur appartient sans les administrer.
|
|
454
464
|
* Constant : GET_ORGANIZATIONS_NO_ADMIN
|
|
@@ -1376,6 +1376,189 @@ export interface GetPoisAdminData {
|
|
|
1376
1376
|
};
|
|
1377
1377
|
[k: string]: unknown;
|
|
1378
1378
|
}
|
|
1379
|
+
export interface GlobalAutocompleteAdminCostumData {
|
|
1380
|
+
/**
|
|
1381
|
+
* Nom ou mot-clé de la recherche
|
|
1382
|
+
*/
|
|
1383
|
+
name?: string;
|
|
1384
|
+
/**
|
|
1385
|
+
* Localités ciblées. Trois formes acceptées : object keyé (forme historique), array d'objets (forme alternative consommée par `foreach`), ou chaîne vide (placeholder = pas de filtre).
|
|
1386
|
+
*/
|
|
1387
|
+
locality?: {
|
|
1388
|
+
/**
|
|
1389
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
1390
|
+
* via the `patternProperty` "^[^\s]+$".
|
|
1391
|
+
*/
|
|
1392
|
+
[k: string]: {
|
|
1393
|
+
/**
|
|
1394
|
+
* Identifiant de la localité
|
|
1395
|
+
*/
|
|
1396
|
+
id: string;
|
|
1397
|
+
/**
|
|
1398
|
+
* Type de localité
|
|
1399
|
+
*/
|
|
1400
|
+
type: "cities" | "cp" | "country" | "level1" | "level2" | "level3" | "level4" | "level5";
|
|
1401
|
+
postalCode?: string;
|
|
1402
|
+
countryCode?: string;
|
|
1403
|
+
name?: string;
|
|
1404
|
+
level?: string | number;
|
|
1405
|
+
};
|
|
1406
|
+
} | {
|
|
1407
|
+
id: string;
|
|
1408
|
+
type: "cities" | "cp" | "country" | "level1" | "level2" | "level3" | "level4" | "level5";
|
|
1409
|
+
postalCode?: string;
|
|
1410
|
+
countryCode?: string;
|
|
1411
|
+
name?: string;
|
|
1412
|
+
level?: string | number;
|
|
1413
|
+
}[] | "";
|
|
1414
|
+
/**
|
|
1415
|
+
* Types d'entités à inclure dans la recherche
|
|
1416
|
+
*/
|
|
1417
|
+
searchType: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "answers" | "forms" | "classifieds")[];
|
|
1418
|
+
/**
|
|
1419
|
+
* Balises (tags) à utiliser pour filtrer la recherche
|
|
1420
|
+
*/
|
|
1421
|
+
searchTags?: string[];
|
|
1422
|
+
/**
|
|
1423
|
+
* Liste fixe des types à compter dans les résultats
|
|
1424
|
+
*/
|
|
1425
|
+
countType?: ("NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative" | "organizations" | "projects" | "events" | "citoyens" | "poi" | "answers" | "forms" | "classifieds")[];
|
|
1426
|
+
/**
|
|
1427
|
+
* 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
|
+
*/
|
|
1429
|
+
searchBy?: string | [string, ...string[]];
|
|
1430
|
+
/**
|
|
1431
|
+
* Index de départ global pour la pagination
|
|
1432
|
+
*/
|
|
1433
|
+
indexMin?: number;
|
|
1434
|
+
/**
|
|
1435
|
+
* Index de fin global pour la pagination
|
|
1436
|
+
*/
|
|
1437
|
+
indexMax?: number;
|
|
1438
|
+
/**
|
|
1439
|
+
* Nombre d’éléments à récupérer (limite de pagination)
|
|
1440
|
+
*/
|
|
1441
|
+
indexStep?: number;
|
|
1442
|
+
/**
|
|
1443
|
+
* Configuration des plages de résultats pour chaque type de recherche
|
|
1444
|
+
*/
|
|
1445
|
+
ranges?: {
|
|
1446
|
+
/**
|
|
1447
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
1448
|
+
* via the `patternProperty` "^[^\s]+$".
|
|
1449
|
+
*/
|
|
1450
|
+
[k: string]: {
|
|
1451
|
+
/**
|
|
1452
|
+
* Index de départ pour la pagination
|
|
1453
|
+
*/
|
|
1454
|
+
indexMin: number;
|
|
1455
|
+
/**
|
|
1456
|
+
* Index de fin pour la pagination
|
|
1457
|
+
*/
|
|
1458
|
+
indexMax: number;
|
|
1459
|
+
};
|
|
1460
|
+
};
|
|
1461
|
+
/**
|
|
1462
|
+
* Type initial de la recherche, vide par défaut
|
|
1463
|
+
*/
|
|
1464
|
+
initType?: "";
|
|
1465
|
+
/**
|
|
1466
|
+
* Indique si les types doivent être comptés dans les résultats
|
|
1467
|
+
*/
|
|
1468
|
+
count?: true;
|
|
1469
|
+
/**
|
|
1470
|
+
* Filtres additionnels appliqués à la recherche (objet ou chaîne vide)
|
|
1471
|
+
*/
|
|
1472
|
+
filters?: {
|
|
1473
|
+
[k: string]: unknown;
|
|
1474
|
+
} | "";
|
|
1475
|
+
/**
|
|
1476
|
+
* Liste des champs à retourner
|
|
1477
|
+
*/
|
|
1478
|
+
fields?: string[];
|
|
1479
|
+
/**
|
|
1480
|
+
* Champ de tri (clé = champ, valeur = 1 ou -1)
|
|
1481
|
+
*/
|
|
1482
|
+
sortBy?: {
|
|
1483
|
+
[k: string]: 1 | -1;
|
|
1484
|
+
};
|
|
1485
|
+
/**
|
|
1486
|
+
* Indique si la recherche doit s'étendre au Fediverse (toujours désactivé)
|
|
1487
|
+
*/
|
|
1488
|
+
fediverse?: boolean;
|
|
1489
|
+
/**
|
|
1490
|
+
* Indique si la recherche est effectuée à partir d'une carte (toujours désactivé)
|
|
1491
|
+
*/
|
|
1492
|
+
mapUsed?: true;
|
|
1493
|
+
/**
|
|
1494
|
+
* Indique si on doit exclure les éléments avec une source
|
|
1495
|
+
*/
|
|
1496
|
+
notSourceKey?: true;
|
|
1497
|
+
/**
|
|
1498
|
+
* ID du contexte de recherche (actuellement vide)
|
|
1499
|
+
*/
|
|
1500
|
+
contextId?: string;
|
|
1501
|
+
/**
|
|
1502
|
+
* Type de contexte de recherche (actuellement vide)
|
|
1503
|
+
*/
|
|
1504
|
+
contextType?: "projects" | "organizations";
|
|
1505
|
+
/**
|
|
1506
|
+
* Slug du costume utilisé pour la recherche
|
|
1507
|
+
*/
|
|
1508
|
+
costumSlug?: string;
|
|
1509
|
+
/**
|
|
1510
|
+
* Alias historique de `contextId` — id du contexte costum. Le backend lit l'un OU l'autre (`isset($post['contextId']) ? ... : $post['costumId']`).
|
|
1511
|
+
*/
|
|
1512
|
+
costumId?: string;
|
|
1513
|
+
/**
|
|
1514
|
+
* Alias historique de `contextType` — type du contexte costum.
|
|
1515
|
+
*/
|
|
1516
|
+
costumType?: "projects" | "organizations";
|
|
1517
|
+
/**
|
|
1518
|
+
* Mode d'affichage / comportement côté backend. Valeurs observées : `table` (charge `creatorData`), `mapWithDirectory`. String libre.
|
|
1519
|
+
*/
|
|
1520
|
+
mode?: string;
|
|
1521
|
+
/**
|
|
1522
|
+
* Clés de source pour la recherche
|
|
1523
|
+
*/
|
|
1524
|
+
sourceKey?: string[];
|
|
1525
|
+
/**
|
|
1526
|
+
* Indique si le mode d'édition du costume est activé (toujours désactivé)
|
|
1527
|
+
*/
|
|
1528
|
+
costumEditMode?: boolean;
|
|
1529
|
+
options?: {
|
|
1530
|
+
tags?: {
|
|
1531
|
+
/**
|
|
1532
|
+
* Verbe d'action pour le filtre de recherche
|
|
1533
|
+
*/
|
|
1534
|
+
verb?: string;
|
|
1535
|
+
[k: string]: unknown;
|
|
1536
|
+
};
|
|
1537
|
+
[k: string]: unknown;
|
|
1538
|
+
};
|
|
1539
|
+
/**
|
|
1540
|
+
* Tri prioritaire (legacy $_POST['sort']) : {champ: 1|-1}. Contrairement à sortBy (première clé seulement), sort est passé tel quel à MongoDB — à préférer pour le tri des tables admin.
|
|
1541
|
+
*/
|
|
1542
|
+
sort?: {
|
|
1543
|
+
/**
|
|
1544
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
1545
|
+
* via the `patternProperty` "^[^\s]+$".
|
|
1546
|
+
*/
|
|
1547
|
+
[k: string]: 1 | -1 | "1" | "-1";
|
|
1548
|
+
};
|
|
1549
|
+
pathParams?: {
|
|
1550
|
+
/**
|
|
1551
|
+
* Collection de l'élément contexte (hôte du costum)
|
|
1552
|
+
*/
|
|
1553
|
+
type: "organizations" | "projects" | "events" | "citoyens";
|
|
1554
|
+
/**
|
|
1555
|
+
* ID de l'élément contexte
|
|
1556
|
+
*/
|
|
1557
|
+
id: string;
|
|
1558
|
+
[k: string]: unknown;
|
|
1559
|
+
};
|
|
1560
|
+
[k: string]: unknown;
|
|
1561
|
+
}
|
|
1379
1562
|
export interface GetOrganizationsNoAdminData {
|
|
1380
1563
|
/**
|
|
1381
1564
|
* Nom ou terme recherché
|