@communecter/cocolight-api-client 1.0.118 → 1.0.120
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.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/ApiClient.ts +1 -2
- package/src/api/BaseEntity.ts +80 -13
- package/src/api/Comment.ts +1 -1
- package/src/api/EndpointApi.ts +31 -1
- package/src/api/EndpointApi.types.ts +57 -1
- package/src/api/User.ts +40 -18
- package/src/api/UserApi.ts +1 -1
- package/src/api/serverDataType/Zone.ts +33 -0
- package/src/endpoints.module.ts +4 -1
- package/src/index.ts +1 -0
- package/types/api/BaseEntity.d.ts +39 -1
- package/types/api/EndpointApi.d.ts +19 -1
- package/types/api/EndpointApi.types.d.ts +53 -1
- package/types/api/User.d.ts +15 -6
- package/types/api/serverDataType/Zone.d.ts +30 -0
- package/types/endpoints.module.d.ts +797 -0
- package/types/index.d.ts +1 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, GetNewsData, GetGalleryData, GlobalAutocompleteCostumData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestDatesData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetOrganizationsAdminData, GetOrganizationsNoAdminData, GetProjectsAdminData, GetProjectsNoAdminData, GetPoisAdminData, GetPoisNoAdminData, GetSubscribersData, GetBadgesData, CoformAnswersSearchData, SearchMemberAutocompleteData, GetEventsData } from "./EndpointApi.types.js";
|
|
1
|
+
import type { UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, GetNewsData, GetGalleryData, GlobalAutocompleteCostumData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestDatesData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetOrganizationsAdminData, GetOrganizationsNoAdminData, GetProjectsAdminData, GetProjectsNoAdminData, GetPoisAdminData, GetPoisNoAdminData, GetSubscribersData, GetBadgesData, CoformAnswersSearchData, SearchMemberAutocompleteData, GetEventsData, CostumFilterCoformData, SearchZonesData } from "./EndpointApi.types.js";
|
|
2
2
|
import type { TransformsMap } from "../types/entities.js";
|
|
3
|
+
import type { ZoneItemNormalized } from "./serverDataType/Zone.js";
|
|
3
4
|
/**
|
|
4
5
|
* Types pour les méthodes d'entité (organization, project, poi, event, badge, news)
|
|
5
6
|
* Permettent soit de récupérer une entité existante (GET), soit de créer une nouvelle instance (CREATE)
|
|
@@ -1614,6 +1615,43 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
1614
1615
|
coformAnswersSearch(data?: Partial<CoformAnswersSearchData>, options?: {
|
|
1615
1616
|
restoredState?: PaginatorState;
|
|
1616
1617
|
}): Promise<PaginatorPage<any>>;
|
|
1618
|
+
/**
|
|
1619
|
+
* Récupère les filtres disponibles basés sur les réponses CoForm de l'entité courante.
|
|
1620
|
+
* Utilise le contexte Communecter (costumSlug, contextId, contextType) de l'entité.
|
|
1621
|
+
*
|
|
1622
|
+
* La réponse est un objet indexé par nom de filtre, chaque entrée contenant :
|
|
1623
|
+
* - `count` : nombre de résultats par catégorie
|
|
1624
|
+
* - `results` : valeurs disponibles pour ce filtre (libellé, image, etc.)
|
|
1625
|
+
*
|
|
1626
|
+
* @param data - Paramètres optionnels de recherche
|
|
1627
|
+
* @param data.searchedData - Filtres actifs : clé → `{ label, forms, path, finderPath }`
|
|
1628
|
+
* @returns Objet `Record<filterName, { count, results }>` des filtres disponibles
|
|
1629
|
+
*
|
|
1630
|
+
* @example
|
|
1631
|
+
* const filters = await project.coformFiltersSearch({
|
|
1632
|
+
* searchedData: {
|
|
1633
|
+
* "activités": {
|
|
1634
|
+
* label: "Activités",
|
|
1635
|
+
* forms: "6486d24e9cad105cbf29a777",
|
|
1636
|
+
* path: "lesCommunsDesTierslieux...",
|
|
1637
|
+
* finderPath: "answers.lesCommunsDesTierslieux..."
|
|
1638
|
+
* }
|
|
1639
|
+
* }
|
|
1640
|
+
* });
|
|
1641
|
+
* filters["activités"].count; // { "Atelier": 12, "Coworking": 8 }
|
|
1642
|
+
*/
|
|
1643
|
+
coformFiltersSearch(data?: Partial<CostumFilterCoformData>): Promise<any>;
|
|
1644
|
+
/**
|
|
1645
|
+
* Recherche des zones géographiques selon un pays et un niveau administratif.
|
|
1646
|
+
* Utilise le contexte Communecter de l'entité courante.
|
|
1647
|
+
*
|
|
1648
|
+
* @param data - Paramètres de recherche
|
|
1649
|
+
* @param data.countryCode - Code(s) pays ISO (ex: `["FR"]`)
|
|
1650
|
+
* @param data.level - Niveau(x) administratif(s) (ex: `["1"]`)
|
|
1651
|
+
* @returns Liste des zones correspondantes
|
|
1652
|
+
* @throws {ApiError} Si `countryCode` ou `level` sont absents
|
|
1653
|
+
*/
|
|
1654
|
+
searchZone(data: SearchZonesData): Promise<ZoneItemNormalized[]>;
|
|
1617
1655
|
/**
|
|
1618
1656
|
* ───────────────────────────────
|
|
1619
1657
|
* Pagination restoration methods
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ApiClient from "../ApiClient.js";
|
|
2
|
-
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, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DemoteAdminData } from "./EndpointApi.types.js";
|
|
2
|
+
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, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DemoteAdminData, CostumFilterCoformData, SearchZonesData } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -1059,5 +1059,23 @@ export declare class EndpointApi {
|
|
|
1059
1059
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1060
1060
|
*/
|
|
1061
1061
|
demoteAdmin(data: DemoteAdminData): Promise<any>;
|
|
1062
|
+
/**
|
|
1063
|
+
* Filtre par reponses CoForm : Recuperer tous les filtres possibles via l'answers
|
|
1064
|
+
* Constant : COSTUM_FILTER_COFORM
|
|
1065
|
+
* @param data - Données envoyées à l'API
|
|
1066
|
+
* @returns Les données de réponse.
|
|
1067
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1068
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1069
|
+
*/
|
|
1070
|
+
costumFilterCoform(data: CostumFilterCoformData): Promise<any>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Rechercher des zones géographiques : Rechercher des zones géographiques
|
|
1073
|
+
* Constant : SEARCH_ZONES
|
|
1074
|
+
* @param data - Données envoyées à l'API
|
|
1075
|
+
* @returns Les données de réponse.
|
|
1076
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1077
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1078
|
+
*/
|
|
1079
|
+
searchZones(data: SearchZonesData): Promise<any>;
|
|
1062
1080
|
}
|
|
1063
1081
|
export default EndpointApi;
|
|
@@ -3641,7 +3641,7 @@ export interface GlobalAutocompleteCostumData {
|
|
|
3641
3641
|
/**
|
|
3642
3642
|
* Type de la localité : 'cities' pour une ville ou 'level1' pour une région
|
|
3643
3643
|
*/
|
|
3644
|
-
type: "cities" | "level1";
|
|
3644
|
+
type: "cities" | "level1" | "level2" | "level3" | "level4" | "level5";
|
|
3645
3645
|
};
|
|
3646
3646
|
};
|
|
3647
3647
|
/**
|
|
@@ -4550,3 +4550,55 @@ export interface DemoteAdminData {
|
|
|
4550
4550
|
isAdmin: false;
|
|
4551
4551
|
[k: string]: unknown;
|
|
4552
4552
|
}
|
|
4553
|
+
export interface CostumFilterCoformData {
|
|
4554
|
+
/**
|
|
4555
|
+
* Données de recherche pour le filtre
|
|
4556
|
+
*/
|
|
4557
|
+
searchedData?: {
|
|
4558
|
+
[k: string]: unknown;
|
|
4559
|
+
};
|
|
4560
|
+
/**
|
|
4561
|
+
* Slug du costume
|
|
4562
|
+
*/
|
|
4563
|
+
costumSlug?: string;
|
|
4564
|
+
/**
|
|
4565
|
+
* ID du costume
|
|
4566
|
+
*/
|
|
4567
|
+
costumId?: string;
|
|
4568
|
+
/**
|
|
4569
|
+
* Type du costume
|
|
4570
|
+
*/
|
|
4571
|
+
costumType?: string;
|
|
4572
|
+
[k: string]: unknown;
|
|
4573
|
+
}
|
|
4574
|
+
export interface SearchZonesData {
|
|
4575
|
+
/**
|
|
4576
|
+
* Code du pays pour la recherche
|
|
4577
|
+
*/
|
|
4578
|
+
countryCode: unknown[];
|
|
4579
|
+
/**
|
|
4580
|
+
* Niveau de la zone géographique pour la recherche
|
|
4581
|
+
*/
|
|
4582
|
+
level: unknown[];
|
|
4583
|
+
/**
|
|
4584
|
+
* Critère de tri des résultats
|
|
4585
|
+
*/
|
|
4586
|
+
sortBy?: string;
|
|
4587
|
+
/**
|
|
4588
|
+
* ID du niveau supérieur pour la recherche
|
|
4589
|
+
*/
|
|
4590
|
+
upperLevelId?: string;
|
|
4591
|
+
/**
|
|
4592
|
+
* Slug du costume
|
|
4593
|
+
*/
|
|
4594
|
+
costumSlug?: string;
|
|
4595
|
+
/**
|
|
4596
|
+
* ID du costume
|
|
4597
|
+
*/
|
|
4598
|
+
costumId?: string;
|
|
4599
|
+
/**
|
|
4600
|
+
* Type du costume
|
|
4601
|
+
*/
|
|
4602
|
+
costumType?: string;
|
|
4603
|
+
[k: string]: unknown;
|
|
4604
|
+
}
|
package/types/api/User.d.ts
CHANGED
|
@@ -318,25 +318,34 @@ export declare class User extends BaseEntity<UserItemNormalized> {
|
|
|
318
318
|
unfollow(): Promise<unknown>;
|
|
319
319
|
/**
|
|
320
320
|
* Vérifie si l'utilisateur connecté est ami avec cet utilisateur.
|
|
321
|
-
*
|
|
321
|
+
* @param options - Options de vérification.
|
|
322
|
+
* @param options.silent - Si `true`, retourne `false` au lieu de lever une exception. Par défaut `true`.
|
|
322
323
|
* @returns - True si l'utilisateur connecté est ami, sinon false.
|
|
323
324
|
* @throws {ApiError} - Si l'utilisateur n'est pas connecté.
|
|
324
325
|
*/
|
|
325
|
-
isFriend(
|
|
326
|
+
isFriend(options?: {
|
|
327
|
+
silent?: boolean;
|
|
328
|
+
}): boolean;
|
|
326
329
|
/**
|
|
327
330
|
* Vérifie si l'utilisateur suit l'entité.
|
|
328
|
-
*
|
|
331
|
+
* @param options - Options de vérification.
|
|
332
|
+
* @param options.silent - Si `true`, retourne `false` au lieu de lever une exception. Par défaut `true`.
|
|
329
333
|
* @returns - `true` si l'utilisateur suit l'entité, `false` sinon.
|
|
330
334
|
* @throws {ApiError}
|
|
331
335
|
*/
|
|
332
|
-
isFollower(
|
|
336
|
+
isFollower(options?: {
|
|
337
|
+
silent?: boolean;
|
|
338
|
+
}): boolean;
|
|
333
339
|
/**
|
|
334
340
|
* Vérifie si l'utilisateur est abonné à l'entité.
|
|
335
|
-
*
|
|
341
|
+
* @param options - Options de vérification.
|
|
342
|
+
* @param options.silent - Si `true`, retourne `false` au lieu de lever une exception. Par défaut `true`.
|
|
336
343
|
* @returns - `true` si l'utilisateur est abonné, `false` sinon.
|
|
337
344
|
* @throws {ApiError}
|
|
338
345
|
*/
|
|
339
|
-
isFollowing(
|
|
346
|
+
isFollowing(options?: {
|
|
347
|
+
silent?: boolean;
|
|
348
|
+
}): boolean;
|
|
340
349
|
/**
|
|
341
350
|
* Retourne une entité à partir d'un slug.
|
|
342
351
|
* @param slug - Le slug de l'entité à récupérer.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GeoCoordinates, GeoPosition, IdObject } from "./common.js";
|
|
2
|
+
import type EJSONType from "../../EJSONType.js";
|
|
3
|
+
type ObjectIDCtor = typeof EJSONType["ObjectID"];
|
|
4
|
+
type ObjectID = InstanceType<ObjectIDCtor>;
|
|
5
|
+
export interface ZoneItemNormalized {
|
|
6
|
+
_id: IdObject;
|
|
7
|
+
countryCode: string;
|
|
8
|
+
geo: GeoCoordinates;
|
|
9
|
+
geoPosition: GeoPosition;
|
|
10
|
+
level: string[];
|
|
11
|
+
name: string;
|
|
12
|
+
osmID?: string;
|
|
13
|
+
wikidataID?: string;
|
|
14
|
+
translateId: string;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface ZoneItemJson {
|
|
18
|
+
id: string;
|
|
19
|
+
_id: ObjectID;
|
|
20
|
+
countryCode: string;
|
|
21
|
+
geo: GeoCoordinates;
|
|
22
|
+
geoPosition: GeoPosition;
|
|
23
|
+
level: string[];
|
|
24
|
+
name: string;
|
|
25
|
+
osmID?: string;
|
|
26
|
+
wikidataID?: string;
|
|
27
|
+
translateId: string;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export {};
|