@communecter/cocolight-api-client 1.0.74 → 1.0.76

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.
@@ -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 } 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 } from "./EndpointApi.types.js";
3
3
  /**
4
4
  * Classe EndpointApi générée automatiquement depuis endpoints-copie.json
5
5
  */
@@ -1029,5 +1029,15 @@ export declare class EndpointApi {
1029
1029
  * @throws {Error} - En cas d'erreur inattendue.
1030
1030
  */
1031
1031
  addReportAbuse(data: AddReportAbuseData): Promise<any>;
1032
+ /**
1033
+ * Mettre à jour une valeur de chemin pour une entité : Met à jour une valeur spécifique dans le chemin donné pour une entité.
1034
+ * Constant : UPDATE_PATH_VALUE
1035
+ * @param data - Données envoyées à l'API
1036
+ * @returns Les données de réponse.
1037
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1038
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1039
+ * @throws {Error} - En cas d'erreur inattendue.
1040
+ */
1041
+ updatePathValue(data: UpdatePathValueData): Promise<any>;
1032
1042
  }
1033
1043
  export default EndpointApi;
@@ -4458,3 +4458,25 @@ export interface AddReportAbuseData {
4458
4458
  };
4459
4459
  [k: string]: unknown;
4460
4460
  }
4461
+ export interface UpdatePathValueData {
4462
+ /**
4463
+ * ID de l’utilisateur
4464
+ */
4465
+ id: string;
4466
+ /**
4467
+ * Collection de l’entité
4468
+ */
4469
+ collection: "citoyens" | "organizations" | "projects" | "events" | "poi";
4470
+ /**
4471
+ * Chemin de la valeur à mettre à jour
4472
+ */
4473
+ path: string;
4474
+ arrayForm?: boolean;
4475
+ /**
4476
+ * Valeur à mettre à jour (peut être un objet, un tableau, une chaîne, etc.)
4477
+ */
4478
+ value: {
4479
+ [k: string]: unknown;
4480
+ };
4481
+ [k: string]: unknown;
4482
+ }
@@ -1,12 +1,72 @@
1
1
  import { BaseEntity } from "./BaseEntity.js";
2
2
  import type { PaginatorPage } from "./BaseEntity.js";
3
3
  import type { AddOrganizationData, GetMembersAdminData, GetMembersNoAdminData } from "./EndpointApi.types.js";
4
+ import type { OpeningHoursEntry } from "./serverDataType/common.js";
4
5
  import type { OrganizationItemNormalized } from "./serverDataType/Organization.js";
5
6
  import type { User } from "./User.js";
6
7
  export declare class Organization extends BaseEntity<OrganizationItemNormalized> {
7
8
  static entityType: string;
8
9
  static entityTag: string;
9
10
  static SCHEMA_CONSTANTS: string[];
11
+ static VIRTUAL_SCHEMAS: {
12
+ VIRTUAL_OPENING_HOURS: {
13
+ type: string;
14
+ properties: {
15
+ openingHours: {
16
+ type: string;
17
+ description: string;
18
+ minItems: number;
19
+ maxItems: number;
20
+ items: {
21
+ oneOf: ({
22
+ type: string;
23
+ const: string;
24
+ properties?: undefined;
25
+ required?: undefined;
26
+ additionalProperties?: undefined;
27
+ } | {
28
+ type: string;
29
+ properties: {
30
+ dayOfWeek: {
31
+ type: string;
32
+ enum: string[];
33
+ description: string;
34
+ };
35
+ hours: {
36
+ type: string;
37
+ description: string;
38
+ items: {
39
+ type: string;
40
+ properties: {
41
+ opens: {
42
+ type: string;
43
+ pattern: string;
44
+ description: string;
45
+ };
46
+ closes: {
47
+ type: string;
48
+ pattern: string;
49
+ description: string;
50
+ };
51
+ };
52
+ required: string[];
53
+ additionalProperties: boolean;
54
+ };
55
+ };
56
+ };
57
+ required: string[];
58
+ additionalProperties: boolean;
59
+ const?: undefined;
60
+ })[];
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ static CUSTOM_FIELD_HANDLERS: Map<"openingHours", {
67
+ readonly updateMethod: "updateOpeningHours";
68
+ readonly schemaConstant: "VIRTUAL_OPENING_HOURS";
69
+ }>;
10
70
  static ADD_BLOCKS: Map<"PROFIL_IMAGE" | "ADD_ORGANIZATION", "updateImageProfil" | "addOrganization">;
11
71
  static UPDATE_BLOCKS: Map<"UPDATE_BLOCK_DESCRIPTION" | "UPDATE_BLOCK_INFO" | "UPDATE_BLOCK_SOCIAL" | "UPDATE_BLOCK_LOCALITY" | "UPDATE_BLOCK_SLUG" | "PROFIL_IMAGE", "updateImageProfil" | "updateDescription" | "updateSocial" | "updateLocality" | "updateInfo" | "updateSlug">;
12
72
  defaultFields: Record<string, any>;
@@ -135,6 +195,23 @@ export declare class Organization extends BaseEntity<OrganizationItemNormalized>
135
195
  * Crée une instance de news et la récupère si nécessaire.
136
196
  */
137
197
  news(newsData?: Parameters<BaseEntity<OrganizationItemNormalized>["news"]>[0]): Promise<import("./News.js").News>;
198
+ /**
199
+ * Met à jour les horaires d'ouverture de l'organisation.
200
+ * Utilise UPDATE_PATH_VALUE pour modifier le champ openingHours.
201
+ *
202
+ * @param hours - Tableau de 7 entrées (une par jour de la semaine)
203
+ * @returns Résultat de l'appel API
204
+ * @throws {ApiError} Si l'organisation n'a pas d'ID
205
+ *
206
+ * @example
207
+ * const openingHours = [
208
+ * { dayOfWeek: "Mo", hours: [{ opens: "09:00", closes: "18:00" }] },
209
+ * { dayOfWeek: "Tu", hours: [{ opens: "09:00", closes: "18:00" }] },
210
+ * // ... pour les 7 jours
211
+ * ];
212
+ * await org.updateOpeningHours(openingHours);
213
+ */
214
+ updateOpeningHours(hours: OpeningHoursEntry[]): Promise<unknown>;
138
215
  /**
139
216
  * ───────────────────────────────
140
217
  * Lien utilisateur ↔ organisation
@@ -14875,6 +14875,7 @@ declare const endpoints: {
14875
14875
  const: string;
14876
14876
  default: string;
14877
14877
  type: string;
14878
+ enum?: undefined;
14878
14879
  };
14879
14880
  email: {
14880
14881
  format: string;
@@ -15198,6 +15199,7 @@ declare const endpoints: {
15198
15199
  const: string;
15199
15200
  default: string;
15200
15201
  type: string;
15202
+ enum?: undefined;
15201
15203
  };
15202
15204
  geo: {
15203
15205
  additionalProperties: boolean;
@@ -22045,6 +22047,192 @@ declare const endpoints: {
22045
22047
  pathParams?: undefined;
22046
22048
  params?: undefined;
22047
22049
  functionCocostum?: undefined;
22050
+ } | {
22051
+ auth: string;
22052
+ constant: string;
22053
+ contentType: string;
22054
+ method: string;
22055
+ path: string;
22056
+ request: {
22057
+ additionalProperties: boolean;
22058
+ properties: {
22059
+ arrayForm: {
22060
+ type: string;
22061
+ };
22062
+ collection: {
22063
+ default: string;
22064
+ enum: string[];
22065
+ type: string;
22066
+ const?: undefined;
22067
+ };
22068
+ id: {
22069
+ default: string;
22070
+ pattern: string;
22071
+ type: string;
22072
+ };
22073
+ path: {
22074
+ type: string;
22075
+ };
22076
+ value: {};
22077
+ app?: undefined;
22078
+ email?: undefined;
22079
+ isInvitation?: undefined;
22080
+ mode?: undefined;
22081
+ name?: undefined;
22082
+ pendingUserId?: undefined;
22083
+ pwd?: undefined;
22084
+ username?: undefined;
22085
+ password?: undefined;
22086
+ refreshToken?: undefined;
22087
+ type?: undefined;
22088
+ serverUrl?: undefined;
22089
+ newPassword?: undefined;
22090
+ newPassword2?: undefined;
22091
+ oldPassword?: undefined;
22092
+ scope?: undefined;
22093
+ userId?: undefined;
22094
+ idEntity?: undefined;
22095
+ typeEntity?: undefined;
22096
+ block?: undefined;
22097
+ descMentions?: undefined;
22098
+ description?: undefined;
22099
+ shortDescription?: undefined;
22100
+ typeElement?: undefined;
22101
+ diaspora?: undefined;
22102
+ facebook?: undefined;
22103
+ github?: undefined;
22104
+ gitlab?: undefined;
22105
+ instagram?: undefined;
22106
+ mastodon?: undefined;
22107
+ signal?: undefined;
22108
+ telegram?: undefined;
22109
+ twitter?: undefined;
22110
+ address?: undefined;
22111
+ geo?: undefined;
22112
+ geoPosition?: undefined;
22113
+ slug?: undefined;
22114
+ profil_avatar?: undefined;
22115
+ banner?: undefined;
22116
+ cropH?: undefined;
22117
+ cropW?: undefined;
22118
+ cropX?: undefined;
22119
+ cropY?: undefined;
22120
+ formOrigin?: undefined;
22121
+ parentId?: undefined;
22122
+ parentType?: undefined;
22123
+ tpl?: undefined;
22124
+ listInvite?: undefined;
22125
+ dateLimit?: undefined;
22126
+ indexStep?: undefined;
22127
+ search?: undefined;
22128
+ ids?: undefined;
22129
+ json?: undefined;
22130
+ markdownActive?: undefined;
22131
+ mediaFile?: undefined;
22132
+ mediaImg?: undefined;
22133
+ mentions?: undefined;
22134
+ tags?: undefined;
22135
+ text?: undefined;
22136
+ newsImage?: undefined;
22137
+ newsFile?: undefined;
22138
+ isLive?: undefined;
22139
+ idNews?: undefined;
22140
+ childId?: undefined;
22141
+ childType?: undefined;
22142
+ comment?: undefined;
22143
+ connectType?: undefined;
22144
+ argval?: undefined;
22145
+ contextId?: undefined;
22146
+ contextType?: undefined;
22147
+ parentCommentId?: undefined;
22148
+ params?: undefined;
22149
+ count?: undefined;
22150
+ countType?: undefined;
22151
+ fediverse?: undefined;
22152
+ filters?: undefined;
22153
+ indexMax?: undefined;
22154
+ indexMin?: undefined;
22155
+ initType?: undefined;
22156
+ locality?: undefined;
22157
+ notSourceKey?: undefined;
22158
+ ranges?: undefined;
22159
+ searchBy?: undefined;
22160
+ searchTags?: undefined;
22161
+ searchType?: undefined;
22162
+ countryCode?: undefined;
22163
+ formInMap?: undefined;
22164
+ scopeValue?: undefined;
22165
+ fields?: undefined;
22166
+ pull?: undefined;
22167
+ key?: undefined;
22168
+ preferences?: undefined;
22169
+ role?: undefined;
22170
+ url?: undefined;
22171
+ parent?: undefined;
22172
+ public?: undefined;
22173
+ urls?: undefined;
22174
+ endDate?: undefined;
22175
+ openingHours?: undefined;
22176
+ organizer?: undefined;
22177
+ recurrency?: undefined;
22178
+ startDate?: undefined;
22179
+ timeZone?: undefined;
22180
+ qqfile?: undefined;
22181
+ qqfilename?: undefined;
22182
+ qqtotalfilesize?: undefined;
22183
+ qquuid?: undefined;
22184
+ linkOption?: undefined;
22185
+ searchMode?: undefined;
22186
+ refreshTimestamp?: undefined;
22187
+ action?: undefined;
22188
+ all?: undefined;
22189
+ actor?: undefined;
22190
+ payload?: undefined;
22191
+ criteria?: undefined;
22192
+ isParcours?: undefined;
22193
+ issuer?: undefined;
22194
+ award?: undefined;
22195
+ badgeId?: undefined;
22196
+ evidences?: undefined;
22197
+ narative?: undefined;
22198
+ endDateUTC?: undefined;
22199
+ startDateUTC?: undefined;
22200
+ costumEditMode?: undefined;
22201
+ costumSlug?: undefined;
22202
+ mapUsed?: undefined;
22203
+ options?: undefined;
22204
+ sortBy?: undefined;
22205
+ sourceKey?: undefined;
22206
+ parent_only?: undefined;
22207
+ types?: undefined;
22208
+ date?: undefined;
22209
+ fromToday?: undefined;
22210
+ regions?: undefined;
22211
+ timezone?: undefined;
22212
+ event?: undefined;
22213
+ tl?: undefined;
22214
+ contentKey?: undefined;
22215
+ folderId?: undefined;
22216
+ answerId?: undefined;
22217
+ finderPath?: undefined;
22218
+ details?: undefined;
22219
+ };
22220
+ required: string[];
22221
+ type: string;
22222
+ allOf?: undefined;
22223
+ $defs?: undefined;
22224
+ else?: undefined;
22225
+ if?: undefined;
22226
+ then?: undefined;
22227
+ anyOf?: undefined;
22228
+ startBeforeEnd?: undefined;
22229
+ };
22230
+ generateModule?: undefined;
22231
+ onlyAuthNone?: undefined;
22232
+ postActions?: undefined;
22233
+ pathParams?: undefined;
22234
+ params?: undefined;
22235
+ functionCocostum?: undefined;
22048
22236
  })[];
22049
22237
  };
22050
22238
  export default endpoints;