@communecter/cocolight-api-client 1.0.155 → 1.0.157
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/1035.cocolight-api-client.browser.js +1 -1
- package/dist/1035.cocolight-api-client.cjs +1 -1
- package/dist/1483.cocolight-api-client.browser.js +1 -1
- package/dist/1483.cocolight-api-client.cjs +1 -1
- package/dist/1491.cocolight-api-client.browser.js +1 -1
- package/dist/1491.cocolight-api-client.cjs +1 -1
- package/dist/1494.cocolight-api-client.browser.js +1 -1
- package/dist/1494.cocolight-api-client.cjs +1 -1
- package/dist/1641.cocolight-api-client.browser.js +1 -1
- package/dist/1641.cocolight-api-client.cjs +1 -1
- package/dist/1678.cocolight-api-client.browser.js +1 -1
- package/dist/1678.cocolight-api-client.cjs +1 -1
- package/dist/2041.cocolight-api-client.browser.js +1 -1
- package/dist/2041.cocolight-api-client.cjs +1 -1
- package/dist/2302.cocolight-api-client.browser.js +1 -1
- package/dist/2302.cocolight-api-client.cjs +1 -1
- package/dist/2313.cocolight-api-client.browser.js +1 -1
- package/dist/2313.cocolight-api-client.cjs +1 -1
- package/dist/2379.cocolight-api-client.browser.js +1 -1
- package/dist/2379.cocolight-api-client.cjs +1 -1
- package/dist/2439.cocolight-api-client.browser.js +1 -1
- package/dist/2439.cocolight-api-client.cjs +1 -1
- package/dist/2594.cocolight-api-client.browser.js +1 -1
- package/dist/2594.cocolight-api-client.cjs +1 -1
- package/dist/2766.cocolight-api-client.browser.js +1 -1
- package/dist/2766.cocolight-api-client.cjs +1 -1
- package/dist/2812.cocolight-api-client.browser.js +1 -1
- package/dist/2812.cocolight-api-client.cjs +1 -1
- package/dist/2918.cocolight-api-client.browser.js +1 -1
- package/dist/2918.cocolight-api-client.cjs +1 -1
- package/dist/3028.cocolight-api-client.browser.js +1 -1
- package/dist/3028.cocolight-api-client.cjs +1 -1
- package/dist/3330.cocolight-api-client.browser.js +1 -1
- package/dist/3330.cocolight-api-client.cjs +1 -1
- package/dist/3371.cocolight-api-client.browser.js +1 -1
- package/dist/3371.cocolight-api-client.cjs +1 -1
- package/dist/3401.cocolight-api-client.browser.js +1 -1
- package/dist/3401.cocolight-api-client.cjs +1 -1
- package/dist/3516.cocolight-api-client.browser.js +1 -1
- package/dist/3516.cocolight-api-client.cjs +1 -1
- package/dist/3593.cocolight-api-client.browser.js +1 -1
- package/dist/3593.cocolight-api-client.cjs +1 -1
- package/dist/3764.cocolight-api-client.browser.js +1 -1
- package/dist/3764.cocolight-api-client.cjs +1 -1
- package/dist/3873.cocolight-api-client.browser.js +1 -1
- package/dist/3873.cocolight-api-client.cjs +1 -1
- package/dist/3911.cocolight-api-client.browser.js +1 -1
- package/dist/3911.cocolight-api-client.cjs +1 -1
- package/dist/4031.cocolight-api-client.browser.js +1 -1
- package/dist/4031.cocolight-api-client.cjs +1 -1
- package/dist/4152.cocolight-api-client.browser.js +1 -1
- package/dist/4152.cocolight-api-client.cjs +1 -1
- package/dist/4203.cocolight-api-client.browser.js +1 -1
- package/dist/4203.cocolight-api-client.cjs +1 -1
- package/dist/424.cocolight-api-client.browser.js +1 -1
- package/dist/424.cocolight-api-client.cjs +1 -1
- package/dist/435.cocolight-api-client.browser.js +1 -1
- package/dist/435.cocolight-api-client.cjs +1 -1
- package/dist/4402.cocolight-api-client.browser.js +1 -1
- package/dist/4402.cocolight-api-client.cjs +1 -1
- package/dist/4425.cocolight-api-client.browser.js +1 -1
- package/dist/4425.cocolight-api-client.cjs +1 -1
- package/dist/4472.cocolight-api-client.browser.js +1 -1
- package/dist/4472.cocolight-api-client.cjs +1 -1
- package/dist/4914.cocolight-api-client.browser.js +1 -1
- package/dist/4914.cocolight-api-client.cjs +1 -1
- package/dist/4959.cocolight-api-client.browser.js +1 -1
- package/dist/4959.cocolight-api-client.cjs +1 -1
- package/dist/5100.cocolight-api-client.browser.js +1 -1
- package/dist/5100.cocolight-api-client.cjs +1 -1
- package/dist/5111.cocolight-api-client.browser.js +1 -1
- package/dist/5111.cocolight-api-client.cjs +1 -1
- package/dist/5286.cocolight-api-client.browser.js +1 -1
- package/dist/5286.cocolight-api-client.cjs +1 -1
- package/dist/5380.cocolight-api-client.browser.js +1 -1
- package/dist/5380.cocolight-api-client.cjs +1 -1
- package/dist/5383.cocolight-api-client.browser.js +1 -1
- package/dist/5383.cocolight-api-client.cjs +1 -1
- package/dist/5480.cocolight-api-client.browser.js +1 -1
- package/dist/5480.cocolight-api-client.cjs +1 -1
- package/dist/5541.cocolight-api-client.browser.js +1 -1
- package/dist/5541.cocolight-api-client.cjs +1 -1
- package/dist/5839.cocolight-api-client.browser.js +1 -1
- package/dist/5839.cocolight-api-client.cjs +1 -1
- package/dist/5862.cocolight-api-client.browser.js +1 -1
- package/dist/5862.cocolight-api-client.cjs +1 -1
- package/dist/5869.cocolight-api-client.browser.js +1 -1
- package/dist/5869.cocolight-api-client.cjs +1 -1
- package/dist/588.cocolight-api-client.browser.js +1 -1
- package/dist/588.cocolight-api-client.cjs +1 -1
- package/dist/601.cocolight-api-client.browser.js +1 -1
- package/dist/601.cocolight-api-client.cjs +1 -1
- package/dist/6012.cocolight-api-client.browser.js +1 -1
- package/dist/6012.cocolight-api-client.cjs +1 -1
- package/dist/6200.cocolight-api-client.browser.js +1 -1
- package/dist/6200.cocolight-api-client.cjs +1 -1
- package/dist/6369.cocolight-api-client.browser.js +1 -1
- package/dist/6369.cocolight-api-client.cjs +1 -1
- package/dist/7009.cocolight-api-client.browser.js +1 -1
- package/dist/7009.cocolight-api-client.cjs +1 -1
- package/dist/725.cocolight-api-client.browser.js +1 -1
- package/dist/725.cocolight-api-client.cjs +1 -1
- package/dist/7320.cocolight-api-client.browser.js +1 -1
- package/dist/7339.cocolight-api-client.browser.js +1 -1
- package/dist/7339.cocolight-api-client.cjs +1 -1
- package/dist/7398.cocolight-api-client.browser.js +1 -1
- package/dist/7398.cocolight-api-client.cjs +1 -1
- package/dist/7888.cocolight-api-client.browser.js +1 -1
- package/dist/7888.cocolight-api-client.cjs +1 -1
- package/dist/7975.cocolight-api-client.browser.js +1 -1
- package/dist/7975.cocolight-api-client.cjs +1 -1
- package/dist/809.cocolight-api-client.browser.js +1 -1
- package/dist/809.cocolight-api-client.cjs +1 -1
- package/dist/8300.cocolight-api-client.browser.js +1 -1
- package/dist/8300.cocolight-api-client.cjs +1 -1
- package/dist/8317.cocolight-api-client.browser.js +1 -1
- package/dist/8317.cocolight-api-client.cjs +1 -1
- package/dist/8525.cocolight-api-client.browser.js +1 -1
- package/dist/8525.cocolight-api-client.cjs +1 -1
- package/dist/8894.cocolight-api-client.browser.js +1 -1
- package/dist/8894.cocolight-api-client.cjs +1 -1
- package/dist/9301.cocolight-api-client.browser.js +1 -1
- package/dist/9301.cocolight-api-client.cjs +1 -1
- package/dist/9438.cocolight-api-client.browser.js +1 -1
- package/dist/9438.cocolight-api-client.cjs +1 -1
- package/dist/9478.cocolight-api-client.browser.js +1 -1
- package/dist/9478.cocolight-api-client.cjs +1 -1
- package/dist/9568.cocolight-api-client.browser.js +1 -1
- package/dist/9568.cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.browser.js +6 -6
- 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 +7 -17
- package/types/Api.d.ts +1 -0
- package/types/ApiClient.d.ts +10 -1
- package/types/api/Answer.d.ts +27 -9
- package/types/api/BaseEntity.d.ts +77 -0
- package/types/api/EndpointApi.d.ts +51 -3
- package/types/api/EndpointApi.types.d.ts +112 -1
- package/types/api/User.d.ts +20 -0
- package/types/costum/types.d.ts +0 -2
- package/types/endpoints.module.d.ts +3039 -1009
- package/types/index.d.ts +1 -0
- package/types/utils/OfflineClientManager.d.ts +8 -0
- package/types/utils/adminImportExport.d.ts +29 -0
- package/dist/1035.cocolight-api-client.mjs.js +0 -1
- package/dist/1483.cocolight-api-client.mjs.js +0 -1
- package/dist/1491.cocolight-api-client.mjs.js +0 -1
- package/dist/1494.cocolight-api-client.mjs.js +0 -1
- package/dist/1641.cocolight-api-client.mjs.js +0 -1
- package/dist/1678.cocolight-api-client.mjs.js +0 -1
- package/dist/2041.cocolight-api-client.mjs.js +0 -1
- package/dist/2302.cocolight-api-client.mjs.js +0 -1
- package/dist/2313.cocolight-api-client.mjs.js +0 -1
- package/dist/2379.cocolight-api-client.mjs.js +0 -1
- package/dist/2439.cocolight-api-client.mjs.js +0 -1
- package/dist/2594.cocolight-api-client.mjs.js +0 -1
- package/dist/2766.cocolight-api-client.mjs.js +0 -1
- package/dist/2812.cocolight-api-client.mjs.js +0 -1
- package/dist/2918.cocolight-api-client.mjs.js +0 -1
- package/dist/3028.cocolight-api-client.mjs.js +0 -1
- package/dist/3330.cocolight-api-client.mjs.js +0 -1
- package/dist/3371.cocolight-api-client.mjs.js +0 -1
- package/dist/3401.cocolight-api-client.mjs.js +0 -1
- package/dist/3516.cocolight-api-client.mjs.js +0 -1
- package/dist/3593.cocolight-api-client.mjs.js +0 -1
- package/dist/3764.cocolight-api-client.mjs.js +0 -1
- package/dist/3873.cocolight-api-client.mjs.js +0 -1
- package/dist/3911.cocolight-api-client.mjs.js +0 -1
- package/dist/4031.cocolight-api-client.mjs.js +0 -1
- package/dist/4152.cocolight-api-client.mjs.js +0 -1
- package/dist/4203.cocolight-api-client.mjs.js +0 -1
- package/dist/424.cocolight-api-client.mjs.js +0 -1
- package/dist/435.cocolight-api-client.mjs.js +0 -1
- package/dist/4402.cocolight-api-client.mjs.js +0 -1
- package/dist/4425.cocolight-api-client.mjs.js +0 -1
- package/dist/4472.cocolight-api-client.mjs.js +0 -1
- package/dist/4914.cocolight-api-client.mjs.js +0 -1
- package/dist/4959.cocolight-api-client.mjs.js +0 -1
- package/dist/5100.cocolight-api-client.mjs.js +0 -1
- package/dist/5111.cocolight-api-client.mjs.js +0 -1
- package/dist/5286.cocolight-api-client.mjs.js +0 -1
- package/dist/5380.cocolight-api-client.mjs.js +0 -1
- package/dist/5383.cocolight-api-client.mjs.js +0 -1
- package/dist/5480.cocolight-api-client.mjs.js +0 -1
- package/dist/5541.cocolight-api-client.mjs.js +0 -1
- package/dist/5839.cocolight-api-client.mjs.js +0 -1
- package/dist/5862.cocolight-api-client.mjs.js +0 -1
- package/dist/5869.cocolight-api-client.mjs.js +0 -1
- package/dist/588.cocolight-api-client.mjs.js +0 -1
- package/dist/601.cocolight-api-client.mjs.js +0 -1
- package/dist/6012.cocolight-api-client.mjs.js +0 -1
- package/dist/6200.cocolight-api-client.mjs.js +0 -1
- package/dist/6369.cocolight-api-client.mjs.js +0 -1
- package/dist/7009.cocolight-api-client.mjs.js +0 -1
- package/dist/725.cocolight-api-client.mjs.js +0 -1
- package/dist/7339.cocolight-api-client.mjs.js +0 -1
- package/dist/7398.cocolight-api-client.mjs.js +0 -1
- package/dist/7888.cocolight-api-client.mjs.js +0 -1
- package/dist/7975.cocolight-api-client.mjs.js +0 -1
- package/dist/809.cocolight-api-client.mjs.js +0 -1
- package/dist/8300.cocolight-api-client.mjs.js +0 -1
- package/dist/8317.cocolight-api-client.mjs.js +0 -1
- package/dist/8525.cocolight-api-client.mjs.js +0 -1
- package/dist/8894.cocolight-api-client.mjs.js +0 -1
- package/dist/9301.cocolight-api-client.mjs.js +0 -1
- package/dist/9438.cocolight-api-client.mjs.js +0 -1
- package/dist/9478.cocolight-api-client.mjs.js +0 -1
- package/dist/9568.cocolight-api-client.mjs.js +0 -1
- package/dist/cocolight-api-client.mjs.js +0 -1
- package/src/Api.ts +0 -348
- package/src/ApiClient.ts +0 -1994
- package/src/EJSONType.ts +0 -103
- package/src/api/Action.ts +0 -665
- package/src/api/Answer.ts +0 -1392
- package/src/api/Badge.ts +0 -143
- package/src/api/BaseEntity.ts +0 -6384
- package/src/api/Classified.ts +0 -175
- package/src/api/Comment.ts +0 -280
- package/src/api/EndpointApi.ts +0 -2270
- package/src/api/EndpointApi.types.ts +0 -6566
- package/src/api/EntityRegistry.ts +0 -324
- package/src/api/Event.ts +0 -360
- package/src/api/Form.ts +0 -282
- package/src/api/News.ts +0 -547
- package/src/api/Notifications.ts +0 -196
- package/src/api/Organization.ts +0 -771
- package/src/api/Poi.ts +0 -242
- package/src/api/Project.ts +0 -545
- package/src/api/User.ts +0 -1889
- package/src/api/UserApi.ts +0 -192
- package/src/api/serverDataType/Action.ts +0 -177
- package/src/api/serverDataType/Answer.ts +0 -106
- package/src/api/serverDataType/Classified.ts +0 -152
- package/src/api/serverDataType/Comment.ts +0 -88
- package/src/api/serverDataType/Country.ts +0 -1
- package/src/api/serverDataType/Event.ts +0 -112
- package/src/api/serverDataType/Form.ts +0 -157
- package/src/api/serverDataType/News.ts +0 -138
- package/src/api/serverDataType/Notification.ts +0 -81
- package/src/api/serverDataType/Organization.ts +0 -111
- package/src/api/serverDataType/Poi.ts +0 -75
- package/src/api/serverDataType/Project.ts +0 -115
- package/src/api/serverDataType/User.ts +0 -112
- package/src/api/serverDataType/Zone.ts +0 -33
- package/src/api/serverDataType/common.ts +0 -84
- package/src/costum/normalize.ts +0 -7
- package/src/costum/registry.ts +0 -138
- package/src/costum/runtime-map.ts +0 -221
- package/src/costum/runtime.ts +0 -274
- package/src/costum/schemas/CercleTravailleursSociauxLiberauxLaPlumeSociale.ts +0 -19
- package/src/costum/schemas/FabEn.ts +0 -19
- package/src/costum/schemas/LivingLabInnovationSocialeBraspanon.ts +0 -19
- package/src/costum/schemas/alfph.ts +0 -27
- package/src/costum/schemas/campagne.ts +0 -19
- package/src/costum/schemas/chtitube.ts +0 -19
- package/src/costum/schemas/circuitCourt.ts +0 -19
- package/src/costum/schemas/cmcasHauteBretagne.ts +0 -19
- package/src/costum/schemas/coFinancementTierslieux.ts +0 -27
- package/src/costum/schemas/coeurNumerique.ts +0 -19
- package/src/costum/schemas/communLundi.ts +0 -19
- package/src/costum/schemas/cressReunion.ts +0 -35
- package/src/costum/schemas/cressReunionNetwork.ts +0 -35
- package/src/costum/schemas/ctenat.ts +0 -43
- package/src/costum/schemas/cyberReunion.ts +0 -19
- package/src/costum/schemas/ekisphere.ts +0 -35
- package/src/costum/schemas/equipementsSportifs974.ts +0 -19
- package/src/costum/schemas/federationDesCae.ts +0 -19
- package/src/costum/schemas/formationGenerique.ts +0 -35
- package/src/costum/schemas/franceTierslieux.ts +0 -19
- package/src/costum/schemas/hinaura.ts +0 -27
- package/src/costum/schemas/hubmayotte.ts +0 -19
- package/src/costum/schemas/hubnouvellecaledonie.ts +0 -19
- package/src/costum/schemas/hubpolynesiefrancaise.ts +0 -19
- package/src/costum/schemas/hubreunion.ts +0 -19
- package/src/costum/schemas/hubterritoires.ts +0 -19
- package/src/costum/schemas/hubwallisetfutuna.ts +0 -19
- package/src/costum/schemas/hva.ts +0 -27
- package/src/costum/schemas/ibv2.ts +0 -19
- package/src/costum/schemas/institutBleu.ts +0 -19
- package/src/costum/schemas/journalInsoumisChambery.ts +0 -27
- package/src/costum/schemas/kpacite.ts +0 -19
- package/src/costum/schemas/laCompagnieDesTierslieux.ts +0 -43
- package/src/costum/schemas/laMaisonDesFaiseurs.ts +0 -19
- package/src/costum/schemas/laReunionPourUnNumeriqueInclusif.ts +0 -19
- package/src/costum/schemas/laSemaineDesTierslieux.ts +0 -19
- package/src/costum/schemas/labEnCommuns.ts +0 -19
- package/src/costum/schemas/lakou.ts +0 -27
- package/src/costum/schemas/lesCommunsDesTierslieux.ts +0 -19
- package/src/costum/schemas/mayottePourUnNumeriqueInclusif.ts +0 -19
- package/src/costum/schemas/meir.ts +0 -27
- package/src/costum/schemas/navigatorDesTierslieux.ts +0 -19
- package/src/costum/schemas/notragora.ts +0 -27
- package/src/costum/schemas/nouvellecaledoniePourUnNumeriqueInclusif.ts +0 -19
- package/src/costum/schemas/openAtlas.ts +0 -19
- package/src/costum/schemas/polynesieFrancaisePourUnNumeriqueInclusif.ts +0 -19
- package/src/costum/schemas/prdr.ts +0 -19
- package/src/costum/schemas/reseauTierslieux.ts +0 -19
- package/src/costum/schemas/rfflabs.ts +0 -19
- package/src/costum/schemas/ries.ts +0 -19
- package/src/costum/schemas/siteDuPactePourLaTransition.ts +0 -27
- package/src/costum/schemas/sportSanteBienetre.ts +0 -43
- package/src/costum/schemas/suppa.ts +0 -19
- package/src/costum/schemas/terramies.ts +0 -19
- package/src/costum/schemas/testeTplFormation.ts +0 -35
- package/src/costum/schemas/tierslieuxbelgique.ts +0 -19
- package/src/costum/schemas/tierslieuxorg1.ts +0 -35
- package/src/costum/schemas/transiter.ts +0 -35
- package/src/costum/schemas/vhelioPeiTour2025.ts +0 -19
- package/src/costum/schemas/wallisetfutunaPourUnNumeriqueInclusif.ts +0 -19
- package/src/costum/symbol.ts +0 -26
- package/src/costum/types.ts +0 -895
- package/src/endpoints.module.ts +0 -4253
- package/src/error.ts +0 -86
- package/src/forms/entityForm.ts +0 -142
- package/src/index.ts +0 -161
- package/src/mixin/UserMixin.ts +0 -4
- package/src/types/api-responses.ts +0 -217
- package/src/types/entities.ts +0 -58
- package/src/types/error-guards.ts +0 -230
- package/src/types/index.ts +0 -41
- package/src/types/payloads.ts +0 -21
- package/src/types/transforms.ts +0 -119
- package/src/utils/FileOfflineStorageStrategy.node.ts +0 -50
- package/src/utils/FileStorageStrategy.node.ts +0 -63
- package/src/utils/MultiServerFileStorageStrategy.node.ts +0 -67
- package/src/utils/MultiServerTokenStorageStrategy.ts +0 -139
- package/src/utils/OfflineClientManager.ts +0 -216
- package/src/utils/OfflineQueueStorageStrategy.ts +0 -47
- package/src/utils/TokenStorage.ts +0 -77
- package/src/utils/compat.ts +0 -12
- package/src/utils/createDefaultMultiServerTokenStorageStrategy.ts +0 -35
- package/src/utils/createDefaultOfflineStrategy.ts +0 -34
- package/src/utils/createDefaultTokenStorageStrategy.ts +0 -33
- package/src/utils/reactive.ts +0 -243
- package/src/utils/stream-utils.node.ts +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@communecter/cocolight-api-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.157",
|
|
4
4
|
"description": "Client Axios simplifié pour l'API cocolight",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"default": "./dist/cocolight-api-client.vite.mjs.js"
|
|
19
19
|
},
|
|
20
20
|
"require": "./dist/cocolight-api-client.cjs",
|
|
21
|
-
"default": "./dist/cocolight-api-client.mjs.js"
|
|
21
|
+
"default": "./dist/cocolight-api-client.vite.mjs.js"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"types": "./types/index.d.ts",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"test": "vitest run",
|
|
27
27
|
"test:watch": "vitest watch",
|
|
28
28
|
"test:ui": "vitest --ui",
|
|
29
|
-
"test:old": "node --experimental-vm-modules ./node_modules/.bin/jest --config jest.config.js",
|
|
30
29
|
"exemple": "node exemple/exemple.js",
|
|
31
30
|
"exemple-api": "tsx exemple/exemple-api.ts",
|
|
32
31
|
"lint": "eslint ./src ./scripts --ext .js,.ts",
|
|
@@ -34,14 +33,12 @@
|
|
|
34
33
|
"typecheck": "tsc --noEmit",
|
|
35
34
|
"build:browser": "webpack --config webpack.config.standalone.js",
|
|
36
35
|
"build:node": "webpack --config webpack.config.node.js",
|
|
37
|
-
"build:esm": "webpack --config webpack.config.esm.mjs",
|
|
38
36
|
"build:esm:rollup": "rollup -c rollup.config.mjs",
|
|
39
|
-
"verif:esm": "webpack --config webpack.config.esm.mjs --profile --json > stats.json",
|
|
40
37
|
"build:ts": "tsc --project tsconfig.json",
|
|
41
38
|
"build:types": "npm run generate:methodeapi && tsc --project tsconfig.types.json",
|
|
42
|
-
"
|
|
39
|
+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
40
|
+
"build": "npm run clean && npm run generate:module:publish && npm run generate:methodeapi && npm run generate:doc && npm run lint && npm run build:browser && npm run build:node && npm run build:esm:rollup && npm run build:types",
|
|
43
41
|
"build:publish": "npm run build && npm publish --access public",
|
|
44
|
-
"generate:module": "node ./scripts/transform-json-module.js",
|
|
45
42
|
"generate:module:publish": "node ./scripts/transform-json-module.publish.js",
|
|
46
43
|
"generate:doc": "node ./scripts/generate-doc.js",
|
|
47
44
|
"generate:reponses": "node ./scripts/generate-constant-response-200.js",
|
|
@@ -59,7 +56,6 @@
|
|
|
59
56
|
"license": "MIT",
|
|
60
57
|
"files": [
|
|
61
58
|
"dist/",
|
|
62
|
-
"src/",
|
|
63
59
|
"types/",
|
|
64
60
|
"package.json",
|
|
65
61
|
"README.md"
|
|
@@ -79,11 +75,7 @@
|
|
|
79
75
|
"pino-pretty": "^13.0.0"
|
|
80
76
|
},
|
|
81
77
|
"devDependencies": {
|
|
82
|
-
"@babel/core": "^7.26.10",
|
|
83
|
-
"@babel/preset-env": "^7.26.9",
|
|
84
|
-
"@babel/preset-typescript": "^7.27.1",
|
|
85
78
|
"@eslint/js": "^9.23.0",
|
|
86
|
-
"@rollup/plugin-babel": "^6.0.4",
|
|
87
79
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
88
80
|
"@rollup/plugin-json": "^6.1.0",
|
|
89
81
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
@@ -93,13 +85,11 @@
|
|
|
93
85
|
"@types/ejson": "^2.2.2",
|
|
94
86
|
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
95
87
|
"@typescript-eslint/parser": "^8.46.2",
|
|
96
|
-
"@vitest/ui": "^4.
|
|
88
|
+
"@vitest/ui": "^4.1.9",
|
|
97
89
|
"ajv": "^8.17.1",
|
|
98
90
|
"ajv-formats": "^3.0.1",
|
|
99
91
|
"axios": "^1.4.0",
|
|
100
92
|
"axios-retry": "^4.5.0",
|
|
101
|
-
"babel-jest": "^29.7.0",
|
|
102
|
-
"babel-loader": "^10.0.0",
|
|
103
93
|
"bson-objectid": "^2.0.4",
|
|
104
94
|
"dotenv": "^17.2.3",
|
|
105
95
|
"ejson": "^2.2.3",
|
|
@@ -108,7 +98,6 @@
|
|
|
108
98
|
"events": "^3.3.0",
|
|
109
99
|
"file-type": "^16.5.4",
|
|
110
100
|
"globals": "^16.0.0",
|
|
111
|
-
"jest": "^29.7.0",
|
|
112
101
|
"json-schema-to-typescript": "^15.0.4",
|
|
113
102
|
"jwt-decode": "^4.0.0",
|
|
114
103
|
"nodemon": "^3.1.9",
|
|
@@ -116,11 +105,12 @@
|
|
|
116
105
|
"pino-pretty": "^13.0.0",
|
|
117
106
|
"rollup": "^4.40.0",
|
|
118
107
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
108
|
+
"terser-webpack-plugin": "^5.3.14",
|
|
119
109
|
"ts-loader": "^9.5.4",
|
|
120
110
|
"tslib": "^2.8.1",
|
|
121
111
|
"tsx": "^4.20.6",
|
|
122
112
|
"typescript": "^5.9.2",
|
|
123
|
-
"vitest": "^4.
|
|
113
|
+
"vitest": "^4.1.9",
|
|
124
114
|
"webpack": "^5.98.0",
|
|
125
115
|
"webpack-cli": "^6.0.1"
|
|
126
116
|
}
|
package/types/Api.d.ts
CHANGED
package/types/ApiClient.d.ts
CHANGED
|
@@ -77,6 +77,8 @@ export default class ApiClient extends EventEmitter {
|
|
|
77
77
|
private readonly _baseURL;
|
|
78
78
|
private readonly _refreshUrl;
|
|
79
79
|
private readonly _endpoints;
|
|
80
|
+
/** Index constant -> endpoint, construit une fois (évite un .find() O(n) sur ~141 endpoints par appel). */
|
|
81
|
+
private readonly _endpointsByConstant;
|
|
80
82
|
private readonly _debug;
|
|
81
83
|
private readonly _fromJSONValue;
|
|
82
84
|
private readonly _tokenStorage;
|
|
@@ -120,11 +122,18 @@ export default class ApiClient extends EventEmitter {
|
|
|
120
122
|
* Extrait l'identifiant depuis un JWT.
|
|
121
123
|
*/
|
|
122
124
|
private _getIdFromToken;
|
|
125
|
+
/** Promesse de refresh en cours, partagée par toutes les requêtes 401 concurrentes (single-flight). */
|
|
126
|
+
private _refreshPromise;
|
|
123
127
|
/**
|
|
124
128
|
* Méthode simplifiée de refresh (en JSON).
|
|
125
|
-
*
|
|
129
|
+
* Single-flight : un seul appel réseau /refresh à la fois. Les 401 concurrents
|
|
130
|
+
* attendent la même promesse au lieu de déclencher N refresh en parallèle — ce qui,
|
|
131
|
+
* avec un refresh token à usage unique/rotatif, faisait échouer toutes les rafales
|
|
132
|
+
* sauf la première et détruisait la session via resetSession().
|
|
133
|
+
* Emet un event refreshSuccess si ça marche.
|
|
126
134
|
*/
|
|
127
135
|
private _refreshAccessToken;
|
|
136
|
+
private _performTokenRefresh;
|
|
128
137
|
/**
|
|
129
138
|
* checkCircuitBreaker : vérifie si on peut appeler l'API ou non
|
|
130
139
|
* si le breaker est "open", on regarde si on peut "reset"
|
package/types/api/Answer.d.ts
CHANGED
|
@@ -277,13 +277,16 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
|
|
|
277
277
|
/**
|
|
278
278
|
* {@inheritDoc BaseEntity#deleteFile}
|
|
279
279
|
*
|
|
280
|
-
* Override
|
|
281
|
-
* `
|
|
282
|
-
* `
|
|
283
|
-
*
|
|
280
|
+
* Override Answer : appelle l'endpoint coform **answer-authorisé**
|
|
281
|
+
* `DELETE_COFORM_ANSWER_FILE` (`{formId, answerId, docId}`) plutôt que le
|
|
282
|
+
* `DELETE_DOCUMENT_BY_ID` générique (qui opère par docId nu, sans contexte
|
|
283
|
+
* d'autorisation). Le backend vérifie ainsi le droit d'éditer CETTE réponse
|
|
284
|
+
* (propriétaire OU `canAdminAnswer`) — même périmètre d'auth que l'upload,
|
|
285
|
+
* sans dépendre du `canEdit` générique du document.
|
|
284
286
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
+
* Après succès : **cleanup local** — retire le `docId` des structures uploader
|
|
288
|
+
* normalisées `{updateDate, files: {docId: docPath}}` dans `serverData.answers`
|
|
289
|
+
* et `_draftData.answers`. Le caller n'a pas besoin de refetch.
|
|
287
290
|
*
|
|
288
291
|
* @example
|
|
289
292
|
* const files = await answer.getFiles({ subKey: "sf.input", docType: "image" });
|
|
@@ -291,6 +294,20 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
|
|
|
291
294
|
* // answer.serverData.answers[sf][input].files[files[0].docId] === undefined
|
|
292
295
|
*/
|
|
293
296
|
deleteFile(docId: string): Promise<void>;
|
|
297
|
+
/**
|
|
298
|
+
* Supprime PLUSIEURS fichiers uploader en une seule opération, par batches
|
|
299
|
+
* parallèles (défaut 4 simultanés) — MIROIR exact du batching d'upload de
|
|
300
|
+
* `processUploads` (réutilise `_uploadInBatches`). Chaque suppression passe
|
|
301
|
+
* par `deleteFile` (endpoint answer-authorisé + cleanup local).
|
|
302
|
+
*
|
|
303
|
+
* Best-effort : une suppression échouée (ex. fichier déjà supprimé côté
|
|
304
|
+
* serveur) est loguée mais n'interrompt PAS les autres. Conçue pour la
|
|
305
|
+
* réconciliation au save (fichiers retirés du formulaire) : le caller fait
|
|
306
|
+
* **un seul appel** au lieu d'une boucle de requêtes.
|
|
307
|
+
*
|
|
308
|
+
* @param docIds - liste des docId à supprimer (vide → no-op).
|
|
309
|
+
*/
|
|
310
|
+
deleteFiles(docIds: readonly string[]): Promise<void>;
|
|
294
311
|
/**
|
|
295
312
|
* Walk `answers[subFormId][inputId]` et retire `docId` des structures
|
|
296
313
|
* `{updateDate, files: {docId: docPath}}` (format canonique uploader).
|
|
@@ -355,13 +372,14 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
|
|
|
355
372
|
* chaque step.
|
|
356
373
|
*
|
|
357
374
|
* Constant : `GET_COFORM_MULTIEVAL_DATA` (POST
|
|
358
|
-
* `/survey/coform/getmultievaldata`, auth
|
|
359
|
-
*
|
|
375
|
+
* `/survey/coform/getmultievaldata`, auth none — radar lisible déconnecté).
|
|
376
|
+
* Lecture publique du radar agrégé ; l'identité des contributeurs est
|
|
377
|
+
* renvoyée telle quelle (anonymisation pour visiteurs anonymes à ajouter
|
|
378
|
+
* si besoin).
|
|
360
379
|
*
|
|
361
380
|
* @param opts.stepKey - Optionnel : filtrer aux datasets d'une seule
|
|
362
381
|
* step. Sinon retourne toutes les steps.
|
|
363
382
|
* @throws {ApiError} 400 si Answer sans id.
|
|
364
|
-
* @throws {ApiAuthenticationError} si non connecté.
|
|
365
383
|
*
|
|
366
384
|
* @example
|
|
367
385
|
* const data = await answer.getMultiEvalData();
|
|
@@ -434,6 +434,8 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
434
434
|
* @returns {boolean}
|
|
435
435
|
*/
|
|
436
436
|
hasChanges(): boolean;
|
|
437
|
+
/** Chaîne EJSON canonique d'un objet nettoyé, pour comparaison d'égalité (cf. hasChanges). */
|
|
438
|
+
private _ejsonForCompare;
|
|
437
439
|
/**
|
|
438
440
|
* Rafraîchit l'entité en rechargeant ses données depuis le serveur.
|
|
439
441
|
* @returns Données mises à jour
|
|
@@ -1729,6 +1731,81 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
1729
1731
|
isAdmin?: "" | "admin";
|
|
1730
1732
|
roles?: string[];
|
|
1731
1733
|
}>): Promise<unknown>;
|
|
1734
|
+
/**
|
|
1735
|
+
* Contexte costum de CETTE entité (résolu de son `source.key`) — requis par l'import/export admin.
|
|
1736
|
+
* @throws {ApiError} si l'entité n'est pas rattachée à un costum.
|
|
1737
|
+
* @private
|
|
1738
|
+
*/
|
|
1739
|
+
private _requireCostumCtx;
|
|
1740
|
+
/**
|
|
1741
|
+
* PRÉVISUALISE un import (GEOCODAGE / Import::Geocodage) : géocode + valide chaque ligne SANS rien
|
|
1742
|
+
* insérer. À appeler AVANT `importElements` pour montrer à l'utilisateur les adresses résolues et les
|
|
1743
|
+
* erreurs/warnings, puis confirmer. `data` est JSON-encodé en interne ; la réponse (map par rowIndex)
|
|
1744
|
+
* est normalisée en tableau ordonné. (Le géocodage ne dépend pas du type d'élément.)
|
|
1745
|
+
*
|
|
1746
|
+
* @param rows - Lignes à prévisualiser (objets plats `{ name, address?, … }`).
|
|
1747
|
+
* @returns `{ rows: [{ rowIndex, success, data?, warnings?, msgErrorAddress? }] }`.
|
|
1748
|
+
*/
|
|
1749
|
+
previewImport(rows: Array<Record<string, unknown>>): Promise<{
|
|
1750
|
+
rows: Array<{
|
|
1751
|
+
rowIndex: string;
|
|
1752
|
+
success: boolean;
|
|
1753
|
+
data?: Record<string, unknown>;
|
|
1754
|
+
warnings?: string[];
|
|
1755
|
+
msgErrorAddress?: string;
|
|
1756
|
+
}>;
|
|
1757
|
+
}>;
|
|
1758
|
+
/**
|
|
1759
|
+
* Importe en masse des éléments SOUS le costum de cette entité (IMPORT_ELEMENTS / importData).
|
|
1760
|
+
* Méthode de haut niveau à PRÉFÉRER à `endpointApi.importElements`. `costumSlug/costumId/costumType`
|
|
1761
|
+
* sont dérivés du `_costumCtx` (source.key) — pas de paramètre costum à fournir. Les lignes sont
|
|
1762
|
+
* découpées en lots (`chunkSize`) pour la progression ; `data` est JSON-encodé en interne. Le backend
|
|
1763
|
+
* (re)vérifie + déduplique (update si le nom existe déjà) + insère + relie au costum.
|
|
1764
|
+
*
|
|
1765
|
+
* @param type - Collection cible (poi/organizations/projects/events/citoyens).
|
|
1766
|
+
* @param rows - Lignes à importer (objets plats `{ name, …champs }`).
|
|
1767
|
+
* @param opts.chunkSize - Taille de lot (def. 50). @param opts.onProgress - `(current,total)` par lot.
|
|
1768
|
+
* @returns `{ result, elements (par rowIndex), attributesWithTypes, progress, summary:{created,updated,errors} }`.
|
|
1769
|
+
*/
|
|
1770
|
+
importElements(type: "poi" | "organizations" | "projects" | "events" | "citoyens", rows: Array<Record<string, unknown>>, opts?: {
|
|
1771
|
+
chunkSize?: number;
|
|
1772
|
+
onProgress?: (current: number, total: number) => void;
|
|
1773
|
+
}): Promise<{
|
|
1774
|
+
result: boolean;
|
|
1775
|
+
elements: Record<string, unknown>;
|
|
1776
|
+
attributesWithTypes: Record<string, unknown>;
|
|
1777
|
+
progress: {
|
|
1778
|
+
current: number;
|
|
1779
|
+
total: number;
|
|
1780
|
+
};
|
|
1781
|
+
summary: {
|
|
1782
|
+
created: number;
|
|
1783
|
+
updated: number;
|
|
1784
|
+
errors: number;
|
|
1785
|
+
};
|
|
1786
|
+
}>;
|
|
1787
|
+
/** Agrège la réponse d'import en `{créés, mis à jour, erreurs}` pour l'UI. @private */
|
|
1788
|
+
private _summarizeImport;
|
|
1789
|
+
/**
|
|
1790
|
+
* Exporte les éléments du costum de cette entité (EXPORT_ELEMENTS / getCsvAdmin). Méthode haut niveau.
|
|
1791
|
+
* Scope automatiquement sur `source.key` = costum de l'entité (`_costumCtx.slug`). RÉSERVÉ aux
|
|
1792
|
+
* super-admins côté backend (gater l'UI via `me.isSuperAdmin()`). Renvoie `{ results, fields }` ;
|
|
1793
|
+
* utiliser le helper `toCsv(results, fields)` pour produire le CSV téléchargeable.
|
|
1794
|
+
*
|
|
1795
|
+
* @param params.searchType - Types/collections à exporter (+ name/filters/fields/labels/multicolumn optionnels).
|
|
1796
|
+
* @returns `{ results, fields }`.
|
|
1797
|
+
*/
|
|
1798
|
+
exportElements(params: {
|
|
1799
|
+
searchType: string[];
|
|
1800
|
+
name?: string;
|
|
1801
|
+
filters?: Record<string, unknown>;
|
|
1802
|
+
fields?: string[];
|
|
1803
|
+
labels?: Record<string, unknown>;
|
|
1804
|
+
multicolumn?: boolean;
|
|
1805
|
+
}): Promise<{
|
|
1806
|
+
results: unknown[];
|
|
1807
|
+
fields: unknown;
|
|
1808
|
+
}>;
|
|
1732
1809
|
/** UUID v4 compatible browser + Node (`crypto.randomUUID()` si dispo, sinon fallback). @private */
|
|
1733
1810
|
private _uuidV4;
|
|
1734
1811
|
/**
|
|
@@ -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, 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 } 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, 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 } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -1046,6 +1046,16 @@ export declare class EndpointApi {
|
|
|
1046
1046
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1047
1047
|
*/
|
|
1048
1048
|
coformUploadAnswerFile(data: CoformUploadAnswerFileData): Promise<any>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Supprimer un fichier d'une réponse CoForm : Supprime un document (image/fichier) attaché à une réponse CoForm, identifié par son docId, après contrôle d'accès answer-side (owner ou Coform::canAdminAnswer). Pendant suppression de COFORM_UPLOAD_ANSWER_FILE.
|
|
1051
|
+
* Constant : DELETE_COFORM_ANSWER_FILE
|
|
1052
|
+
* @param data - Données envoyées à l'API
|
|
1053
|
+
* @returns Les données de réponse.
|
|
1054
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1055
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1056
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1057
|
+
*/
|
|
1058
|
+
deleteCoformAnswerFile(data: DeleteCoformAnswerFileData): Promise<any>;
|
|
1049
1059
|
/**
|
|
1050
1060
|
* Récupérer les fichiers d'une réponse CoForm : Récupère la liste des fichiers uploadés pour un input spécifique dans une réponse CoForm. Utilisé pour récupérer les fichiers de l'ancien système qui n'ont que 'updateDate' sans la clé 'files'.
|
|
1051
1061
|
* Constant : COFORM_GET_ANSWER_FILES
|
|
@@ -1086,12 +1096,11 @@ export declare class EndpointApi {
|
|
|
1086
1096
|
*/
|
|
1087
1097
|
getCoformAnswerHistory(data: GetCoformAnswerHistoryData): Promise<any>;
|
|
1088
1098
|
/**
|
|
1089
|
-
* Récupérer les données agrégées d'évaluation multiple (radar) d'une réponse coform : Pour une réponse coform partagée comportant des inputs radioNew avec activeMultieval=true, retourne les datasets agrégés (1 par utilisateur contributeur) pour chaque step. Lecture tolérante : priorité au format canonical `value`, fallback sur le format legacy `answer` '{idx}_{slug}'.
|
|
1099
|
+
* Récupérer les données agrégées d'évaluation multiple (radar) d'une réponse coform : Pour une réponse coform partagée comportant des inputs radioNew avec activeMultieval=true, retourne les datasets agrégés (1 par utilisateur contributeur) pour chaque step. Lecture tolérante : priorité au format canonical `value`, fallback sur le format legacy `answer` '{idx}_{slug}'. Lecture publique du radar agrégé (visible déconnecté) ; l'identité des contributeurs (userId/userName/userSlug) est renvoyée telle quelle — anonymisation pour visiteurs anonymes à ajouter si besoin.
|
|
1090
1100
|
* Constant : GET_COFORM_MULTIEVAL_DATA
|
|
1091
1101
|
* @param data - Données envoyées à l'API
|
|
1092
1102
|
* @returns Les données de réponse.
|
|
1093
1103
|
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1094
|
-
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1095
1104
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1096
1105
|
*/
|
|
1097
1106
|
getCoformMultievalData(data: GetCoformMultievalDataData): Promise<any>;
|
|
@@ -1394,5 +1403,44 @@ export declare class EndpointApi {
|
|
|
1394
1403
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1395
1404
|
*/
|
|
1396
1405
|
personActivate(data: PersonActivateData): Promise<any>;
|
|
1406
|
+
/**
|
|
1407
|
+
* Prévisualiser un import (table de contrôle) : Construit la table d'affichage [name, address, warnings, msgError] d'une liste d'éléments déjà vérifiés (Import::createArrayList), pour prévisualiser un import avant insertion.
|
|
1408
|
+
* Constant : IMPORT_PREVIEW
|
|
1409
|
+
* @param data - Données envoyées à l'API
|
|
1410
|
+
* @returns Les données de réponse.
|
|
1411
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1412
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1413
|
+
*/
|
|
1414
|
+
importPreview(data: ImportPreviewData): Promise<any>;
|
|
1415
|
+
/**
|
|
1416
|
+
* Exporter des éléments (CSV admin) : Recherche admin et renvoie {results, fields} prêt pour un parser CSV (Csv::getCsvAdmin). Réservé aux super-admins (sinon {results:[],fields:[]}). Les events sont reshapés forme-carte (getSimpleEventById).
|
|
1417
|
+
* Constant : EXPORT_ELEMENTS
|
|
1418
|
+
* @param data - Données envoyées à l'API
|
|
1419
|
+
* @returns Les données de réponse.
|
|
1420
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1421
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1422
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1423
|
+
*/
|
|
1424
|
+
exportElements(data: ExportElementsData): Promise<any>;
|
|
1425
|
+
/**
|
|
1426
|
+
* Importer des éléments en masse : Import en masse d'éléments (Import::importData) : typage microformat, déduplication par nom, save + lien au costum. `data` = JSON encodé d'un tableau de lignes.
|
|
1427
|
+
* Constant : IMPORT_ELEMENTS
|
|
1428
|
+
* @param data - Données envoyées à l'API
|
|
1429
|
+
* @returns Les données de réponse.
|
|
1430
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1431
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1432
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1433
|
+
*/
|
|
1434
|
+
importElements(data: ImportElementsData): Promise<any>;
|
|
1435
|
+
/**
|
|
1436
|
+
* Géocoder/valider des lignes d'import (preview) : Géocode + valide chaque ligne SANS insérer (Import::Geocodage) : résout l'adresse par code postal (cities), renvoie success/data/msgErrorAddress par ligne. Étape de prévisualisation avant import. `data` = JSON encodé d'un tableau de lignes.
|
|
1437
|
+
* Constant : GEOCODAGE
|
|
1438
|
+
* @param data - Données envoyées à l'API
|
|
1439
|
+
* @returns Les données de réponse.
|
|
1440
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1441
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1442
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1443
|
+
*/
|
|
1444
|
+
geocodage(data: GeocodageData): Promise<any>;
|
|
1397
1445
|
}
|
|
1398
1446
|
export default EndpointApi;
|
|
@@ -3428,7 +3428,7 @@ export interface LinkValidateData {
|
|
|
3428
3428
|
/**
|
|
3429
3429
|
* Type de validation
|
|
3430
3430
|
*/
|
|
3431
|
-
linkOption?: "isInviting" | "toBeValidated" | "isAdminPending";
|
|
3431
|
+
linkOption?: "isInviting" | "isAdminInviting" | "toBeValidated" | "isAdminPending";
|
|
3432
3432
|
[k: string]: unknown;
|
|
3433
3433
|
}
|
|
3434
3434
|
export interface SearchMemberAutocompleteData {
|
|
@@ -5119,6 +5119,21 @@ export interface CoformUploadAnswerFileData {
|
|
|
5119
5119
|
};
|
|
5120
5120
|
[k: string]: unknown;
|
|
5121
5121
|
}
|
|
5122
|
+
export interface DeleteCoformAnswerFileData {
|
|
5123
|
+
/**
|
|
5124
|
+
* ID du formulaire parent (contrôle d'accès).
|
|
5125
|
+
*/
|
|
5126
|
+
formId: string;
|
|
5127
|
+
/**
|
|
5128
|
+
* ID de la réponse propriétaire du fichier.
|
|
5129
|
+
*/
|
|
5130
|
+
answerId: string;
|
|
5131
|
+
/**
|
|
5132
|
+
* ID MongoDB du document à supprimer.
|
|
5133
|
+
*/
|
|
5134
|
+
docId: string;
|
|
5135
|
+
[k: string]: unknown;
|
|
5136
|
+
}
|
|
5122
5137
|
export interface CoformGetAnswerFilesData {
|
|
5123
5138
|
/**
|
|
5124
5139
|
* ID de la réponse CoForm
|
|
@@ -5964,3 +5979,99 @@ export interface PersonActivateData {
|
|
|
5964
5979
|
validationKey: string;
|
|
5965
5980
|
[k: string]: unknown;
|
|
5966
5981
|
}
|
|
5982
|
+
export interface ImportPreviewData {
|
|
5983
|
+
/**
|
|
5984
|
+
* Liste d'éléments vérifiés à prévisualiser.
|
|
5985
|
+
*/
|
|
5986
|
+
list: {
|
|
5987
|
+
name?: string;
|
|
5988
|
+
address?: {
|
|
5989
|
+
streetAddress?: string;
|
|
5990
|
+
postalCode?: string;
|
|
5991
|
+
addressLocality?: string;
|
|
5992
|
+
addressCountry?: string;
|
|
5993
|
+
[k: string]: unknown;
|
|
5994
|
+
};
|
|
5995
|
+
warnings?: string[];
|
|
5996
|
+
msgError?: string;
|
|
5997
|
+
[k: string]: unknown;
|
|
5998
|
+
}[];
|
|
5999
|
+
[k: string]: unknown;
|
|
6000
|
+
}
|
|
6001
|
+
export interface ExportElementsData {
|
|
6002
|
+
/**
|
|
6003
|
+
* Types/collections à exporter (events, organizations, projects, poi, citoyens, NGO…).
|
|
6004
|
+
*
|
|
6005
|
+
* @minItems 1
|
|
6006
|
+
*/
|
|
6007
|
+
searchType: [string, ...string[]];
|
|
6008
|
+
/**
|
|
6009
|
+
* Terme de recherche optionnel.
|
|
6010
|
+
*/
|
|
6011
|
+
name?: string;
|
|
6012
|
+
/**
|
|
6013
|
+
* Ordre/sélection des colonnes.
|
|
6014
|
+
*/
|
|
6015
|
+
fields?: string[];
|
|
6016
|
+
/**
|
|
6017
|
+
* Libellés de colonnes {indexFieldString: label}.
|
|
6018
|
+
*/
|
|
6019
|
+
labels?: {
|
|
6020
|
+
[k: string]: unknown;
|
|
6021
|
+
};
|
|
6022
|
+
/**
|
|
6023
|
+
* Si défini (≠ faux PHP), colonnes de 1er niveau seulement.
|
|
6024
|
+
*/
|
|
6025
|
+
multicolumn?: {
|
|
6026
|
+
[k: string]: unknown;
|
|
6027
|
+
};
|
|
6028
|
+
/**
|
|
6029
|
+
* Colonnes de contributeurs par rôle.
|
|
6030
|
+
*/
|
|
6031
|
+
roles?: string[];
|
|
6032
|
+
/**
|
|
6033
|
+
* Filtres de recherche.
|
|
6034
|
+
*/
|
|
6035
|
+
filters?: {
|
|
6036
|
+
[k: string]: unknown;
|
|
6037
|
+
};
|
|
6038
|
+
/**
|
|
6039
|
+
* Restreint l'export à ces source.key (scope costum). Posé automatiquement par BaseEntity.exportElements.
|
|
6040
|
+
*/
|
|
6041
|
+
sourceKey?: string[];
|
|
6042
|
+
[k: string]: unknown;
|
|
6043
|
+
}
|
|
6044
|
+
export interface ImportElementsData {
|
|
6045
|
+
/**
|
|
6046
|
+
* Tableau de lignes encodé en JSON (chaque ligne : {name, ...champs, rowIndex?}).
|
|
6047
|
+
*/
|
|
6048
|
+
data: string;
|
|
6049
|
+
/**
|
|
6050
|
+
* Collection cible.
|
|
6051
|
+
*/
|
|
6052
|
+
typeElement: "poi" | "organizations" | "projects" | "events" | "citoyens";
|
|
6053
|
+
/**
|
|
6054
|
+
* Id de l'élément costum parent (rattachement/lien).
|
|
6055
|
+
*/
|
|
6056
|
+
costumId?: string;
|
|
6057
|
+
/**
|
|
6058
|
+
* Type de l'élément costum parent.
|
|
6059
|
+
*/
|
|
6060
|
+
costumType?: string;
|
|
6061
|
+
/**
|
|
6062
|
+
* Slug costum -> source.key.
|
|
6063
|
+
*/
|
|
6064
|
+
costumSlug?: string;
|
|
6065
|
+
/**
|
|
6066
|
+
* Taille totale (progression).
|
|
6067
|
+
*/
|
|
6068
|
+
totalSize?: string;
|
|
6069
|
+
[k: string]: unknown;
|
|
6070
|
+
}
|
|
6071
|
+
export interface GeocodageData {
|
|
6072
|
+
/**
|
|
6073
|
+
* Tableau de lignes encodé en JSON ({name, address?, hotRowIndex?, latitude?, longitude?}).
|
|
6074
|
+
*/
|
|
6075
|
+
data: string;
|
|
6076
|
+
[k: string]: unknown;
|
|
6077
|
+
}
|
package/types/api/User.d.ts
CHANGED
|
@@ -59,6 +59,26 @@ export declare class User extends BaseEntity<UserItemNormalized> {
|
|
|
59
59
|
get isActingUser(): boolean;
|
|
60
60
|
/** @returns {"citoyens"} */
|
|
61
61
|
getEntityType(): "citoyens";
|
|
62
|
+
/**
|
|
63
|
+
* Rôles de l'utilisateur (depuis `serverData.roles`, présent sur `me` après authenticate/meInfo —
|
|
64
|
+
* `ME_PROJECTION` garde `roles` et exclut `pwd`/tokens). Vide si non chargé ou profil public.
|
|
65
|
+
*/
|
|
66
|
+
get roles(): Record<string, unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* Super-admin global STRICT (`roles.superAdmin === true`) — équivalent legacy `Role::isUserSuperAdmin`,
|
|
69
|
+
* et c'est le gate RÉEL de l'export admin (`exportElements`). N'inclut PAS `adminPlatform`.
|
|
70
|
+
*/
|
|
71
|
+
isSuperAdmin(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Admin de plateforme (`roles.adminPlatform === true`). NB : rôle hors-legacy (absent du PHP) mais
|
|
74
|
+
* HONORÉ par le backend comme super-admin (cf. isUserSuperAdmin/deleteElement) ; posé en base, pas par le code.
|
|
75
|
+
*/
|
|
76
|
+
isAdminPlatform(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Accès admin plateforme large : `superAdmin || adminPlatform` (= `isUserSuperAdmin` backend général,
|
|
79
|
+
* celui de la suppression). Pour gater l'UI ; l'export reste sur `isSuperAdmin()` strict.
|
|
80
|
+
*/
|
|
81
|
+
canPlatformAdmin(): boolean;
|
|
62
82
|
/**
|
|
63
83
|
* Récupère le profil complet de l'utilisateur.
|
|
64
84
|
* Si l'utilisateur est connecté, on appelle le endpoint ME_INFO_URL,
|
package/types/costum/types.d.ts
CHANGED
|
@@ -216,7 +216,6 @@ export interface CostumFieldMap {
|
|
|
216
216
|
place?: string;
|
|
217
217
|
};
|
|
218
218
|
organizations: {
|
|
219
|
-
extraActivity?: string[];
|
|
220
219
|
formLocality?: string;
|
|
221
220
|
location?: string;
|
|
222
221
|
similarLink?: string;
|
|
@@ -497,7 +496,6 @@ export interface CostumFieldMap {
|
|
|
497
496
|
lakou: {
|
|
498
497
|
organizations: {
|
|
499
498
|
buildingSurfaceArea?: number;
|
|
500
|
-
extraActivity?: string[];
|
|
501
499
|
extraManageModel?: string;
|
|
502
500
|
extraTypePlace?: string;
|
|
503
501
|
formLocality?: string;
|