@communecter/cocolight-api-client 1.0.185 → 1.0.186
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 +97 -0
- package/types/api/EndpointApi.d.ts +41 -1
- package/types/api/EndpointApi.types.d.ts +192 -0
- package/types/endpoints.module.d.ts +1873 -0
package/package.json
CHANGED
|
@@ -2012,6 +2012,103 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
2012
2012
|
result: boolean;
|
|
2013
2013
|
msg?: string;
|
|
2014
2014
|
}>;
|
|
2015
|
+
/** Corps commun check/apply — `to` défaut = costum de cette entité (repreneur = site courant). */
|
|
2016
|
+
private _ownershipTransferBody;
|
|
2017
|
+
/**
|
|
2018
|
+
* Analyse (DRY-RUN) d'un transfert d'appropriation — aucune écriture. Renvoie `canApply`, les
|
|
2019
|
+
* contrôles d'uniformité (bloquants/warnings), les compteurs (byLocality/byType), la résolution
|
|
2020
|
+
* du sous-type, la comparaison de schéma costum et un exemple avant/après.
|
|
2021
|
+
*/
|
|
2022
|
+
checkOwnershipTransfer(params: Parameters<BaseEntity["_ownershipTransferBody"]>[0]): Promise<{
|
|
2023
|
+
result: boolean;
|
|
2024
|
+
msg?: string;
|
|
2025
|
+
canApply?: boolean;
|
|
2026
|
+
counts?: {
|
|
2027
|
+
selected: number;
|
|
2028
|
+
byLocality: Record<string, number>;
|
|
2029
|
+
byType: Record<string, number>;
|
|
2030
|
+
};
|
|
2031
|
+
controls?: {
|
|
2032
|
+
id: string;
|
|
2033
|
+
level: "blocking" | "warning";
|
|
2034
|
+
count: number;
|
|
2035
|
+
ids: string[];
|
|
2036
|
+
}[];
|
|
2037
|
+
subType?: {
|
|
2038
|
+
mode: string;
|
|
2039
|
+
value: string | null;
|
|
2040
|
+
types: (string | null)[];
|
|
2041
|
+
};
|
|
2042
|
+
schema?: {
|
|
2043
|
+
fromFields: number;
|
|
2044
|
+
toFields: number;
|
|
2045
|
+
missing: string[];
|
|
2046
|
+
};
|
|
2047
|
+
sample?: {
|
|
2048
|
+
id: string;
|
|
2049
|
+
name: string | null;
|
|
2050
|
+
before: unknown;
|
|
2051
|
+
after: unknown;
|
|
2052
|
+
} | null;
|
|
2053
|
+
}>;
|
|
2054
|
+
/**
|
|
2055
|
+
* APPLIQUE le transfert : re-déroule intégralement le check côté serveur (refus au moindre
|
|
2056
|
+
* bloquant, et si `expectedCount` — le compteur affiché au dry-run — a dérivé), journalise le run
|
|
2057
|
+
* dans `sourceMigrations` (snapshot AVANT écriture), écrit, et renvoie `migrationId` + compteurs
|
|
2058
|
+
* auto-vérifiés. Rollbackable via rollbackOwnershipTransfer(migrationId).
|
|
2059
|
+
*/
|
|
2060
|
+
applyOwnershipTransfer(params: Parameters<BaseEntity["_ownershipTransferBody"]>[0] & {
|
|
2061
|
+
expectedCount?: number;
|
|
2062
|
+
}): Promise<{
|
|
2063
|
+
result: boolean;
|
|
2064
|
+
msg?: string;
|
|
2065
|
+
migrationId?: string;
|
|
2066
|
+
controls?: {
|
|
2067
|
+
id: string;
|
|
2068
|
+
level: "blocking" | "warning";
|
|
2069
|
+
count: number;
|
|
2070
|
+
ids: string[];
|
|
2071
|
+
}[];
|
|
2072
|
+
applied?: {
|
|
2073
|
+
migrated: number;
|
|
2074
|
+
referenceAdded: number;
|
|
2075
|
+
annotated: number;
|
|
2076
|
+
selfReferenceCleaned: number;
|
|
2077
|
+
};
|
|
2078
|
+
verification?: {
|
|
2079
|
+
ownedByTo: number;
|
|
2080
|
+
stillOwnedByFrom: number;
|
|
2081
|
+
};
|
|
2082
|
+
}>;
|
|
2083
|
+
/**
|
|
2084
|
+
* ANNULE un transfert : restaure, depuis le snapshot du run, les racines source/reference de
|
|
2085
|
+
* chaque fiche encore en état post-migration. Rollback PARTIEL accepté (`skipped` : moved =
|
|
2086
|
+
* re-transférée depuis, missing = supprimée). Gate recalculé sur les slugs DU RUN.
|
|
2087
|
+
*/
|
|
2088
|
+
rollbackOwnershipTransfer(migrationId: string): Promise<{
|
|
2089
|
+
result: boolean;
|
|
2090
|
+
msg?: string;
|
|
2091
|
+
restored?: number;
|
|
2092
|
+
skipped?: {
|
|
2093
|
+
id: string;
|
|
2094
|
+
reason: "moved" | "missing";
|
|
2095
|
+
}[];
|
|
2096
|
+
status?: string;
|
|
2097
|
+
}>;
|
|
2098
|
+
/**
|
|
2099
|
+
* HISTORIQUE des transferts dont le costum de cette entité est cédant ou repreneur (created
|
|
2100
|
+
* décroissant, sans snapshot). Avec `migrationId` : le run COMPLET, snapshot inclus — c'est le
|
|
2101
|
+
* téléchargement JSON de rollback côté UI.
|
|
2102
|
+
*/
|
|
2103
|
+
listOwnershipTransfers(params?: {
|
|
2104
|
+
slug?: string;
|
|
2105
|
+
migrationId?: string;
|
|
2106
|
+
}): Promise<{
|
|
2107
|
+
result: boolean;
|
|
2108
|
+
msg?: string;
|
|
2109
|
+
migrations?: Record<string, unknown>[];
|
|
2110
|
+
migration?: Record<string, unknown>;
|
|
2111
|
+
}>;
|
|
2015
2112
|
/** Détache l'élément (type,id) de `source.keys` du costum de cette entité (dé-rattachement). Même
|
|
2016
2113
|
* parité de payload que `removeReference` : jamais `costumId`/`costumType`. */
|
|
2017
2114
|
removeFromSource(type: string, id: string): Promise<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ApiClient from "../ApiClient.js";
|
|
2
|
-
import type { DocumentListData, PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, PasswordResetData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, RelaunchInvitationData, 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, CreateInvitationLinkData, ConnectByRefData, 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, CostumToolsCatalogData, CostumToolUsersData, CostumCommunInfoData, CostumSaveToolEnrichmentData, CostumCommunListData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData, PersonActivateData, PersonValidateInvitationData, ValidateInvitationByMailData, ImportPreviewData, ExportElementsData, ImportElementsData, GeocodageData, ValidateGroupData, SetSourceData, ModerateData, NewsModerateData, CommentModerateData, UploadDocumentData, ZoneGetShapeData, ZoneGetZonirisData, CostumListValuesData, CostumResolvedData, DirectoryProposalData, DirectoryProposalCountData, DirectoryProposalNewCounterData } from "./EndpointApi.types.js";
|
|
2
|
+
import type { DocumentListData, PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, PasswordResetData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, RelaunchInvitationData, 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, CreateInvitationLinkData, ConnectByRefData, 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, CostumToolsCatalogData, CostumToolUsersData, CostumCommunInfoData, CostumSaveToolEnrichmentData, CostumCommunListData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData, PersonActivateData, PersonValidateInvitationData, ValidateInvitationByMailData, ImportPreviewData, ExportElementsData, ImportElementsData, GeocodageData, ValidateGroupData, SetSourceData, TransferSourceCheckData, TransferSourceApplyData, TransferSourceRollbackData, TransferSourceHistoryData, ModerateData, NewsModerateData, CommentModerateData, UploadDocumentData, ZoneGetShapeData, ZoneGetZonirisData, CostumListValuesData, CostumResolvedData, DirectoryProposalData, DirectoryProposalCountData, DirectoryProposalNewCounterData } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -1576,6 +1576,46 @@ export declare class EndpointApi {
|
|
|
1576
1576
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1577
1577
|
*/
|
|
1578
1578
|
setSource(data: SetSourceData): Promise<any>;
|
|
1579
|
+
/**
|
|
1580
|
+
* Analyser un transfert d'appropriation (dry-run) : Migration d'APPROPRIATION : transfère la PROPRIÉTÉ d'un ensemble de fiches du costum `from` vers le costum `to` (source.key/keys : from → to), `from` restant en RÉFÉRENCEMENT (reference.costum += from, + annotation reference.costumTypes.<from>). Réécriture EN PLACE (_id préservé : documents/images, liens, slug, historique intacts). C'est la voie DÉDIÉE et la SEULE : les verrous historiques restent (Element::prepData jette source à l'update ; setsource add refuse set=source). Gate : super-admin OU (admin du costum `from` ET admin du costum `to`) — le cédant consent, le repreneur accepte. Action legacy née EN MIROIR du port Node (byte-parité dès la naissance). MODE CHECK : dry-run STRUCTUREL (aucune écriture) — sélectionne, déroule les contrôles d'uniformité (bloquants : source.keys en objet à trous, provenance divergente, rattachements multiples selon keysPolicy, sous-type indéterminable, champs costum du cédant absents du repreneur [fusion moteur⊕overlay des DEUX slugs, pas la lecture naïve du doc costum], ids introuvables, sélection >5000 ; warnings : référencement préexistant [complété, jamais écrasé], modération en attente [les flags scopés survivent], auto-référencement parasite), déduit le sous-type, compare les schémas costum et renvoie un exemple avant/après. canApply=true autorise l'apply. La sélection est triée _id croissant (déterminisme : sample = plus petit _id, ids des contrôles triés).
|
|
1581
|
+
* Constant : TRANSFER_SOURCE_CHECK
|
|
1582
|
+
* @param data - Données envoyées à l'API
|
|
1583
|
+
* @returns Les données de réponse.
|
|
1584
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1585
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1586
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1587
|
+
*/
|
|
1588
|
+
transferSourceCheck(data: TransferSourceCheckData): Promise<any>;
|
|
1589
|
+
/**
|
|
1590
|
+
* Appliquer un transfert d'appropriation : Migration d'APPROPRIATION : transfère la PROPRIÉTÉ d'un ensemble de fiches du costum `from` vers le costum `to` (source.key/keys : from → to), `from` restant en RÉFÉRENCEMENT (reference.costum += from, + annotation reference.costumTypes.<from>). Réécriture EN PLACE (_id préservé : documents/images, liens, slug, historique intacts). C'est la voie DÉDIÉE et la SEULE : les verrous historiques restent (Element::prepData jette source à l'update ; setsource add refuse set=source). Gate : super-admin OU (admin du costum `from` ET admin du costum `to`) — le cédant consent, le repreneur accepte. Action legacy née EN MIROIR du port Node (byte-parité dès la naissance). MODE APPLY : RE-DÉROULE INTÉGRALEMENT le pipeline de check sur la sélection recalculée (la sélection peut bouger entre check et apply) et refuse au moindre bloquant ; `expectedCount` (posé par l'UI depuis le dry-run) refuse aussi si le compte a dérivé. Puis : insert du run dans sourceMigrations (statut applying + SNAPSHOT {id, source, reference} de chaque fiche AVANT écriture — Mongo 4.2 sans transactions, le rollback est matérialisé), passe de nettoyage cleanSelfReference, écriture ($set source.key/keys + annotation, $addToSet reference.costum — jamais $set de la racine reference), activityStream par fiche, recomptage auto-vérifiant, statut applied. Idempotent par construction : rejouer → sélection vide ou sourceKeyMismatch → refus propre.
|
|
1591
|
+
* Constant : TRANSFER_SOURCE_APPLY
|
|
1592
|
+
* @param data - Données envoyées à l'API
|
|
1593
|
+
* @returns Les données de réponse.
|
|
1594
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1595
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1596
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1597
|
+
*/
|
|
1598
|
+
transferSourceApply(data: TransferSourceApplyData): Promise<any>;
|
|
1599
|
+
/**
|
|
1600
|
+
* Annuler un transfert d'appropriation (rollback) : Migration d'APPROPRIATION : transfère la PROPRIÉTÉ d'un ensemble de fiches du costum `from` vers le costum `to` (source.key/keys : from → to), `from` restant en RÉFÉRENCEMENT (reference.costum += from, + annotation reference.costumTypes.<from>). Réécriture EN PLACE (_id préservé : documents/images, liens, slug, historique intacts). C'est la voie DÉDIÉE et la SEULE : les verrous historiques restent (Element::prepData jette source à l'update ; setsource add refuse set=source). Gate : super-admin OU (admin du costum `from` ET admin du costum `to`) — le cédant consent, le repreneur accepte. Action legacy née EN MIROIR du port Node (byte-parité dès la naissance). MODE ROLLBACK : restaure, fiche par fiche depuis le snapshot du run, les RACINES source et reference ENTIÈRES ($set/$unset racine — jamais de mix racine/sous-chemin dans un même update). Une fiche dont source.key a changé depuis est passée (moved) ; une fiche supprimée aussi (missing) — rollback PARTIEL accepté, compteurs renvoyés. Une édition de CONTENU n'est PAS un conflit (seuls source/reference sont restaurés). Gate recalculé sur les from/to DU RUN (jamais du body). Un run rolledback n'est pas rejouable. Un run resté applying (crash à mi-course) reste rollbackable.
|
|
1601
|
+
* Constant : TRANSFER_SOURCE_ROLLBACK
|
|
1602
|
+
* @param data - Données envoyées à l'API
|
|
1603
|
+
* @returns Les données de réponse.
|
|
1604
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1605
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1606
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1607
|
+
*/
|
|
1608
|
+
transferSourceRollback(data: TransferSourceRollbackData): Promise<any>;
|
|
1609
|
+
/**
|
|
1610
|
+
* Historique des transferts d'appropriation : Migration d'APPROPRIATION : transfère la PROPRIÉTÉ d'un ensemble de fiches du costum `from` vers le costum `to` (source.key/keys : from → to), `from` restant en RÉFÉRENCEMENT (reference.costum += from, + annotation reference.costumTypes.<from>). Réécriture EN PLACE (_id préservé : documents/images, liens, slug, historique intacts). C'est la voie DÉDIÉE et la SEULE : les verrous historiques restent (Element::prepData jette source à l'update ; setsource add refuse set=source). Gate : super-admin OU (admin du costum `from` ET admin du costum `to`) — le cédant consent, le repreneur accepte. Action legacy née EN MIROIR du port Node (byte-parité dès la naissance). MODE HISTORY : sans migrationId, liste les runs (SANS snapshot) où `slug` est cédant ou repreneur, triés created décroissant (gate : super-admin ou admin de `slug`). Avec migrationId : le run COMPLET, snapshot inclus — c'est le téléchargement JSON de rollback côté UI (gate : super-admin ou admin d'un des deux slugs du run). Dates en secondes Unix (scalaires purs — convention byte-parité du né-en-miroir).
|
|
1611
|
+
* Constant : TRANSFER_SOURCE_HISTORY
|
|
1612
|
+
* @param data - Données envoyées à l'API
|
|
1613
|
+
* @returns Les données de réponse.
|
|
1614
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1615
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1616
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1617
|
+
*/
|
|
1618
|
+
transferSourceHistory(data: TransferSourceHistoryData): Promise<any>;
|
|
1579
1619
|
/**
|
|
1580
1620
|
* File de modération (news + commentaires signalés) : File de modération : news et commentaires signalés (reportAbuse) non encore tranchés et non déjà modérés par l'utilisateur courant. Port de ModerateAction (vue HTML → JSON). Les commentaires dont la news parente est flaggée abus sont retirés.
|
|
1581
1621
|
* Constant : MODERATE
|
|
@@ -6733,6 +6733,198 @@ export interface SetSourceData {
|
|
|
6733
6733
|
};
|
|
6734
6734
|
[k: string]: unknown;
|
|
6735
6735
|
}
|
|
6736
|
+
export interface TransferSourceCheckData {
|
|
6737
|
+
/**
|
|
6738
|
+
* Slug du costum CÉDANT (propriétaire actuel des fiches).
|
|
6739
|
+
*/
|
|
6740
|
+
from: string;
|
|
6741
|
+
/**
|
|
6742
|
+
* Slug du costum REPRENEUR (nouveau propriétaire). Posé automatiquement par BaseEntity (= site courant) si absent.
|
|
6743
|
+
*/
|
|
6744
|
+
to: string;
|
|
6745
|
+
/**
|
|
6746
|
+
* Collection des fiches. Sous-ensemble d'ELEMENT_COLLECTIONS — jamais citoyens (profils personnels).
|
|
6747
|
+
*/
|
|
6748
|
+
collection: "poi" | "organizations" | "projects" | "events" | "classifieds";
|
|
6749
|
+
/**
|
|
6750
|
+
* Sélection des fiches : {ids} OU {field,value}. L'endpoint est agnostique du cas d'usage (commune, fusion de costums, correction de provenance, fiche isolée).
|
|
6751
|
+
*/
|
|
6752
|
+
selection: {
|
|
6753
|
+
/**
|
|
6754
|
+
* Sélection explicite par _id (n'importe quelle sélection UI : table, fiche isolée). Les ids passent par TOUS les contrôles. Plafond 1000 : au-delà, le form-urlencoded dépasse max_input_vars PHP (troncature silencieuse legacy) — utiliser le mode critère.
|
|
6755
|
+
*
|
|
6756
|
+
* @minItems 1
|
|
6757
|
+
* @maxItems 1000
|
|
6758
|
+
*/
|
|
6759
|
+
ids: [string, ...string[]];
|
|
6760
|
+
} | {
|
|
6761
|
+
/**
|
|
6762
|
+
* Champ de sélection de masse (whitelist serveur). La requête est {source.keys: from, <field>: value}.
|
|
6763
|
+
*/
|
|
6764
|
+
field: "address.codeInsee" | "address.level1" | "address.level3" | "address.level4" | "address.localityId" | "address.addressLocality" | "tags" | "type";
|
|
6765
|
+
/**
|
|
6766
|
+
* Valeur scalaire du champ (ex. codeInsee "97415").
|
|
6767
|
+
*/
|
|
6768
|
+
value: string;
|
|
6769
|
+
};
|
|
6770
|
+
/**
|
|
6771
|
+
* Options du geste. Défauts appliqués côté client (AJV useDefaults) ET normalisés côté serveur.
|
|
6772
|
+
*/
|
|
6773
|
+
options?: {
|
|
6774
|
+
/**
|
|
6775
|
+
* true (défaut) : from reste en référencement (reference.costum += from) avec annotation éventuelle. false : transfert SEC (ni référence, ni annotation) — correction de provenance.
|
|
6776
|
+
*/
|
|
6777
|
+
keepReference?: boolean;
|
|
6778
|
+
/**
|
|
6779
|
+
* Annotation reference.costumTypes.<from>. "auto" (défaut) = déduite du `type` si la sélection est homogène (sinon bloquant subTypeIndeterminable) ; "" = pas d'annotation ; sinon valeur explicite. Ignorée si keepReference=false.
|
|
6780
|
+
*/
|
|
6781
|
+
subType?: string;
|
|
6782
|
+
/**
|
|
6783
|
+
* Mode réparation générique : cible les fiches DÉJÀ possédées par `to` et référencées par `from` SANS annotation ; pose uniquement reference.costumTypes.<from>. Successeur produit du --repair du script CLI.
|
|
6784
|
+
*/
|
|
6785
|
+
annotateOnly?: boolean;
|
|
6786
|
+
/**
|
|
6787
|
+
* true (défaut) : purge l'auto-référencement parasite de `to` (reference.costum ∋ to, reference.costumTypes.<to>) en passe préalable — séquelle des ré-imports.
|
|
6788
|
+
*/
|
|
6789
|
+
cleanSelfReference?: boolean;
|
|
6790
|
+
/**
|
|
6791
|
+
* strict (défaut) : source.keys multiples = bloquant. replace : remplace from par to DANS keys en préservant les autres clés (ex. marqueur ESS974), écriture par fiche.
|
|
6792
|
+
*/
|
|
6793
|
+
keysPolicy?: "strict" | "replace";
|
|
6794
|
+
};
|
|
6795
|
+
/**
|
|
6796
|
+
* Slug du costum courant (contexte). Posé automatiquement par BaseEntity.
|
|
6797
|
+
*/
|
|
6798
|
+
costumSlug?: string;
|
|
6799
|
+
/**
|
|
6800
|
+
* ID de l'entité porteuse du costum courant. Optionnel.
|
|
6801
|
+
*/
|
|
6802
|
+
costumId?: string;
|
|
6803
|
+
/**
|
|
6804
|
+
* Type de l'entité porteuse du costum courant. Optionnel.
|
|
6805
|
+
*/
|
|
6806
|
+
costumType?: string;
|
|
6807
|
+
[k: string]: unknown;
|
|
6808
|
+
}
|
|
6809
|
+
export interface TransferSourceApplyData {
|
|
6810
|
+
/**
|
|
6811
|
+
* Slug du costum CÉDANT (propriétaire actuel des fiches).
|
|
6812
|
+
*/
|
|
6813
|
+
from: string;
|
|
6814
|
+
/**
|
|
6815
|
+
* Slug du costum REPRENEUR (nouveau propriétaire). Posé automatiquement par BaseEntity (= site courant) si absent.
|
|
6816
|
+
*/
|
|
6817
|
+
to: string;
|
|
6818
|
+
/**
|
|
6819
|
+
* Collection des fiches. Sous-ensemble d'ELEMENT_COLLECTIONS — jamais citoyens (profils personnels).
|
|
6820
|
+
*/
|
|
6821
|
+
collection: "poi" | "organizations" | "projects" | "events" | "classifieds";
|
|
6822
|
+
/**
|
|
6823
|
+
* Sélection des fiches : {ids} OU {field,value}. L'endpoint est agnostique du cas d'usage (commune, fusion de costums, correction de provenance, fiche isolée).
|
|
6824
|
+
*/
|
|
6825
|
+
selection: {
|
|
6826
|
+
/**
|
|
6827
|
+
* Sélection explicite par _id (n'importe quelle sélection UI : table, fiche isolée). Les ids passent par TOUS les contrôles. Plafond 1000 : au-delà, le form-urlencoded dépasse max_input_vars PHP (troncature silencieuse legacy) — utiliser le mode critère.
|
|
6828
|
+
*
|
|
6829
|
+
* @minItems 1
|
|
6830
|
+
* @maxItems 1000
|
|
6831
|
+
*/
|
|
6832
|
+
ids: [string, ...string[]];
|
|
6833
|
+
} | {
|
|
6834
|
+
/**
|
|
6835
|
+
* Champ de sélection de masse (whitelist serveur). La requête est {source.keys: from, <field>: value}.
|
|
6836
|
+
*/
|
|
6837
|
+
field: "address.codeInsee" | "address.level1" | "address.level3" | "address.level4" | "address.localityId" | "address.addressLocality" | "tags" | "type";
|
|
6838
|
+
/**
|
|
6839
|
+
* Valeur scalaire du champ (ex. codeInsee "97415").
|
|
6840
|
+
*/
|
|
6841
|
+
value: string;
|
|
6842
|
+
};
|
|
6843
|
+
/**
|
|
6844
|
+
* Options du geste. Défauts appliqués côté client (AJV useDefaults) ET normalisés côté serveur.
|
|
6845
|
+
*/
|
|
6846
|
+
options?: {
|
|
6847
|
+
/**
|
|
6848
|
+
* true (défaut) : from reste en référencement (reference.costum += from) avec annotation éventuelle. false : transfert SEC (ni référence, ni annotation) — correction de provenance.
|
|
6849
|
+
*/
|
|
6850
|
+
keepReference?: boolean;
|
|
6851
|
+
/**
|
|
6852
|
+
* Annotation reference.costumTypes.<from>. "auto" (défaut) = déduite du `type` si la sélection est homogène (sinon bloquant subTypeIndeterminable) ; "" = pas d'annotation ; sinon valeur explicite. Ignorée si keepReference=false.
|
|
6853
|
+
*/
|
|
6854
|
+
subType?: string;
|
|
6855
|
+
/**
|
|
6856
|
+
* Mode réparation générique : cible les fiches DÉJÀ possédées par `to` et référencées par `from` SANS annotation ; pose uniquement reference.costumTypes.<from>. Successeur produit du --repair du script CLI.
|
|
6857
|
+
*/
|
|
6858
|
+
annotateOnly?: boolean;
|
|
6859
|
+
/**
|
|
6860
|
+
* true (défaut) : purge l'auto-référencement parasite de `to` (reference.costum ∋ to, reference.costumTypes.<to>) en passe préalable — séquelle des ré-imports.
|
|
6861
|
+
*/
|
|
6862
|
+
cleanSelfReference?: boolean;
|
|
6863
|
+
/**
|
|
6864
|
+
* strict (défaut) : source.keys multiples = bloquant. replace : remplace from par to DANS keys en préservant les autres clés (ex. marqueur ESS974), écriture par fiche.
|
|
6865
|
+
*/
|
|
6866
|
+
keysPolicy?: "strict" | "replace";
|
|
6867
|
+
};
|
|
6868
|
+
/**
|
|
6869
|
+
* Compteur affiché à l'utilisateur au dry-run. Si ≠ du recomptage à l'apply → refus (selectionDrift).
|
|
6870
|
+
*/
|
|
6871
|
+
expectedCount?: number;
|
|
6872
|
+
/**
|
|
6873
|
+
* Slug du costum courant (contexte). Posé automatiquement par BaseEntity.
|
|
6874
|
+
*/
|
|
6875
|
+
costumSlug?: string;
|
|
6876
|
+
/**
|
|
6877
|
+
* ID de l'entité porteuse du costum courant. Optionnel.
|
|
6878
|
+
*/
|
|
6879
|
+
costumId?: string;
|
|
6880
|
+
/**
|
|
6881
|
+
* Type de l'entité porteuse du costum courant. Optionnel.
|
|
6882
|
+
*/
|
|
6883
|
+
costumType?: string;
|
|
6884
|
+
[k: string]: unknown;
|
|
6885
|
+
}
|
|
6886
|
+
export interface TransferSourceRollbackData {
|
|
6887
|
+
/**
|
|
6888
|
+
* _id du run dans sourceMigrations (renvoyé par apply, listé par history).
|
|
6889
|
+
*/
|
|
6890
|
+
migrationId: string;
|
|
6891
|
+
/**
|
|
6892
|
+
* Slug du costum courant (contexte). Posé automatiquement par BaseEntity.
|
|
6893
|
+
*/
|
|
6894
|
+
costumSlug?: string;
|
|
6895
|
+
/**
|
|
6896
|
+
* Optionnel.
|
|
6897
|
+
*/
|
|
6898
|
+
costumId?: string;
|
|
6899
|
+
/**
|
|
6900
|
+
* Optionnel.
|
|
6901
|
+
*/
|
|
6902
|
+
costumType?: string;
|
|
6903
|
+
[k: string]: unknown;
|
|
6904
|
+
}
|
|
6905
|
+
export interface TransferSourceHistoryData {
|
|
6906
|
+
/**
|
|
6907
|
+
* Slug dont on liste l'historique (cédant OU repreneur). Posé automatiquement par BaseEntity (= site courant).
|
|
6908
|
+
*/
|
|
6909
|
+
slug: string;
|
|
6910
|
+
/**
|
|
6911
|
+
* Si présent : renvoie CE run complet (avec snapshot) au lieu de la liste.
|
|
6912
|
+
*/
|
|
6913
|
+
migrationId?: string;
|
|
6914
|
+
/**
|
|
6915
|
+
* Slug du costum courant (contexte). Posé automatiquement par BaseEntity.
|
|
6916
|
+
*/
|
|
6917
|
+
costumSlug?: string;
|
|
6918
|
+
/**
|
|
6919
|
+
* Optionnel.
|
|
6920
|
+
*/
|
|
6921
|
+
costumId?: string;
|
|
6922
|
+
/**
|
|
6923
|
+
* Optionnel.
|
|
6924
|
+
*/
|
|
6925
|
+
costumType?: string;
|
|
6926
|
+
[k: string]: unknown;
|
|
6927
|
+
}
|
|
6736
6928
|
export interface ModerateData {
|
|
6737
6929
|
[k: string]: unknown;
|
|
6738
6930
|
}
|