@communecter/cocolight-api-client 1.0.162 → 1.0.163

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@communecter/cocolight-api-client",
3
- "version": "1.0.162",
3
+ "version": "1.0.163",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1735,6 +1735,35 @@ export declare class BaseEntity<TServerData = any> {
1735
1735
  isAdmin?: "" | "admin";
1736
1736
  roles?: string[];
1737
1737
  }>): Promise<unknown>;
1738
+ /**
1739
+ * L'entité porte-t-elle un contexte costum COMPLET (slug + costumId + costumType) ?
1740
+ * Vrai pour une entité chargée avec un `source.key` connu, ou après `setCostumScope()`.
1741
+ */
1742
+ hasCostumScope(): boolean;
1743
+ /**
1744
+ * Pose EXPLICITEMENT le scope costum de l'entité — l'API OFFICIELLE pour rattacher une entité
1745
+ * HÔTE de costum (qui n'a pas de `source.key` : c'est elle la source, la lib ne lui auto-dérive
1746
+ * donc aucun `_costumCtx`) aux méthodes qui l'exigent (`_requireCostumCtx` : `previewImport`,
1747
+ * `importElements`, `exportElements`, `addReference`…).
1748
+ *
1749
+ * Résolution :
1750
+ * 1. le REGISTRE bundlé d'abord (`resolveCostumCtxFromSource` — costum connu : identité + overlay
1751
+ * de champs, source de vérité interne) ;
1752
+ * 2. sinon un contexte NU construit depuis `opts` (costum de config/déploiement hors registre) —
1753
+ * même forme que le fallback interne (schema vide, fields:[]) ;
1754
+ * 3. sinon throw (identité costum introuvable).
1755
+ *
1756
+ * Remplace la mutation externe de `_costumCtx` pratiquée par les fronts (champ INTERNE non
1757
+ * contractuel) — cf. site-json `ensureCostumScope`, à migrer sur cette méthode.
1758
+ *
1759
+ * @param slug - Slug du costum (ex. `"equipementsSportifs974"`).
1760
+ * @param opts.costumId / opts.costumType - Identité de l'élément hôte, requise si le costum
1761
+ * n'est pas dans le registre bundlé (résolue par le front via slug/getinfo).
1762
+ */
1763
+ setCostumScope(slug: string, opts?: {
1764
+ costumId?: string;
1765
+ costumType?: string;
1766
+ }): void;
1738
1767
  /**
1739
1768
  * Contexte costum de CETTE entité (résolu de son `source.key`) — requis par l'import/export admin.
1740
1769
  * @throws {ApiError} si l'entité n'est pas rattachée à un costum.