@communecter/cocolight-api-client 1.0.37 → 1.0.38

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.37",
3
+ "version": "1.0.38",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
@@ -2340,23 +2340,6 @@ export class BaseEntity {
2340
2340
  return endpoint.request.properties[path].default;
2341
2341
  }
2342
2342
 
2343
-
2344
- /**
2345
- * Recherche liée à l'entité, version stateless.
2346
- *
2347
- * @param {Object} data - Données initiales de recherche.
2348
- * @returns {Object} - Un paginateur avec .next(), .prev(), etc.
2349
- */
2350
- async searchCostum(data = {}) {
2351
-
2352
- const paginator = this._createPaginatorEngine({
2353
- initialData: data,
2354
- finalizer: this._withCostumContext((finalData) => this.endpointApi.globalAutocompleteCostum(finalData)),
2355
- });
2356
-
2357
- return paginator.next();
2358
- }
2359
-
2360
2343
  /**
2361
2344
  * Coeur de pagination stateless et réutilisable, sans logique métier.
2362
2345
  *
@@ -2491,6 +2474,22 @@ export class BaseEntity {
2491
2474
  * ───────────────────────────────
2492
2475
  */
2493
2476
 
2477
+ /**
2478
+ * Recherche liée à l'entité, version stateless.
2479
+ *
2480
+ * @param {Object} data - Données initiales de recherche.
2481
+ * @returns {Object} - Un paginateur avec .next(), .prev(), etc.
2482
+ */
2483
+ async searchCostum(data = {}) {
2484
+
2485
+ const paginator = this._createPaginatorEngine({
2486
+ initialData: data,
2487
+ finalizer: this._withCostumContext((finalData) => this.endpointApi.globalAutocompleteCostum(finalData)),
2488
+ });
2489
+
2490
+ return paginator.next();
2491
+ }
2492
+
2494
2493
  async costumEventRequestActors(data = {}){
2495
2494
 
2496
2495
  data = {
package/src/api/Event.js CHANGED
@@ -93,6 +93,19 @@ export class Event extends BaseEntity {
93
93
  return hasChanged;
94
94
  }
95
95
 
96
+ async addEvent(data = {}) {
97
+
98
+ if (!this.isMe && !data.organizer) {
99
+ data.organizer = {};
100
+ data.organizer[`${this.parent.id}`] = {
101
+ type: this.parent.getEntityType(),
102
+ name: this.parent.name
103
+ };
104
+ }
105
+
106
+ return this.callIsConnected(() => this.endpointApi.addEvent(data));
107
+ }
108
+
96
109
  async getOrganizations() {
97
110
  throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`);
98
111
  }