@communecter/cocolight-api-client 1.0.182 → 1.0.183
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/Answer.d.ts +0 -14
- package/types/api/Form.d.ts +19 -0
package/package.json
CHANGED
package/types/api/Answer.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseEntity } from "./BaseEntity.js";
|
|
2
2
|
import type { AnswerItemNormalized } from "./serverDataType/Answer.js";
|
|
3
|
-
import type { CommunInfo } from "./serverDataType/CommunInfo.js";
|
|
4
3
|
import type { FormItemNormalized } from "./serverDataType/Form.js";
|
|
5
4
|
type UploadInput = File | Blob | Buffer | import("stream").Readable;
|
|
6
5
|
/**
|
|
@@ -244,19 +243,6 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
|
|
|
244
243
|
*/
|
|
245
244
|
private _autoFormIdFromParent;
|
|
246
245
|
form(): Promise<never>;
|
|
247
|
-
/**
|
|
248
|
-
* Fiche du **commun** rattaché à un outil : cette Answer EST la réponse AAP du commun
|
|
249
|
-
* (`communId = this.id`). `opts.formId` = **verrou de périmètre** (le serveur vérifie
|
|
250
|
-
* `answer.form === formId`, endpoint `auth: none`) : sans lui, la requête n'a pas de sens (le
|
|
251
|
-
* front ne l'émet pas). Fail-closed → **`null`** en HTTP 200 (jamais de 500) sur entrée invalide.
|
|
252
|
-
*
|
|
253
|
-
* @example
|
|
254
|
-
* const answer = await api.answer({ id: communId });
|
|
255
|
-
* const commun = await answer.getCommunInfo({ formId: communFormId }); // CommunInfo | null
|
|
256
|
-
*/
|
|
257
|
-
getCommunInfo(opts?: {
|
|
258
|
-
formId?: string;
|
|
259
|
-
}): Promise<CommunInfo | null>;
|
|
260
246
|
/**
|
|
261
247
|
* Supprime cette Answer côté serveur via `DELETE_ELEMENT`
|
|
262
248
|
* (`type=answers`, `id=this.id`).
|
package/types/api/Form.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { BaseEntity } from "./BaseEntity.js";
|
|
|
2
2
|
import type { Answer } from "./Answer.js";
|
|
3
3
|
import type { PaginatorPage, PaginatorState } from "./BaseEntity.js";
|
|
4
4
|
import type { CoformAnswersSearchData, DirectoryProposalCountData, DirectoryProposalData, DirectoryProposalNewCounterData } from "./EndpointApi.types.js";
|
|
5
|
+
import type { CommunInfo } from "./serverDataType/CommunInfo.js";
|
|
5
6
|
import type { CoformCommonTableContributor, FormItemNormalized } from "./serverDataType/Form.js";
|
|
6
7
|
import type { ToolsCatalogPage, ToolsCatalogParams, ToolUser, ToolUsersParams } from "./serverDataType/ToolsCatalog.js";
|
|
7
8
|
/**
|
|
@@ -137,6 +138,24 @@ export declare class Form extends BaseEntity<FormItemNormalized> {
|
|
|
137
138
|
* sont sérialisés en JSON (le fil attend une string `string[]` sérialisée).
|
|
138
139
|
*/
|
|
139
140
|
getToolUsers(params: ToolUsersParams): Promise<ToolUser[]>;
|
|
141
|
+
/**
|
|
142
|
+
* Fiche du **commun** rattaché à un outil — `communinfo` (`auth: none`). `this.id` = le form AAP des
|
|
143
|
+
* communs (verrou de périmètre serveur : `answer.form === formId`) ; `communId` = l'`_id` de la
|
|
144
|
+
* réponse AAP du commun. Le serveur ne renvoie qu'une **projection minimale publique** (jamais le
|
|
145
|
+
* `financer[]` nominatif). Fail-closed → **`null`** en HTTP 200 sur entrée invalide (jamais de 500).
|
|
146
|
+
*
|
|
147
|
+
* Placée sur `Form` (et NON `Answer`) À DESSEIN : `api.answer({ id })` déclenche un `get()`
|
|
148
|
+
* (findanswered, auth none) qui télécharge le doc AAP COMPLET — `financer[]` nominatif inclus —
|
|
149
|
+
* dans le navigateur du visiteur, la fuite que `communinfo` est faite pour éviter. `api.form({ id })`
|
|
150
|
+
* ne charge que la définition (publique) du formulaire.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* const form = await api.form({ id: communFormId });
|
|
154
|
+
* const commun = await form.communInfo({ communId }); // CommunInfo | null
|
|
155
|
+
*/
|
|
156
|
+
communInfo(params: {
|
|
157
|
+
communId: string;
|
|
158
|
+
}): Promise<CommunInfo | null>;
|
|
140
159
|
/**
|
|
141
160
|
* {@inheritDoc BaseEntity#answer}
|
|
142
161
|
*
|