@communecter/cocolight-api-client 1.0.59 → 1.0.60

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.59",
3
+ "version": "1.0.60",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
@@ -746,6 +746,25 @@ export class BaseEntity<TServerData = any> {
746
746
  return obj.map((el) => this._removeUnserializables(el, seen));
747
747
  }
748
748
 
749
+ // Preserve native types that EJSON handles natively
750
+ if (obj instanceof Date) {
751
+ return obj;
752
+ }
753
+
754
+ if (obj instanceof RegExp) {
755
+ return obj;
756
+ }
757
+
758
+ // Preserve ObjectID instances (both bson-objectid and custom ObjectID)
759
+ if (obj && typeof obj === "object" && "_bsontype" in obj && obj._bsontype === "ObjectID") {
760
+ return obj;
761
+ }
762
+
763
+ // Preserve binary types (Uint8Array, Buffer, etc.)
764
+ if (obj instanceof Uint8Array || ArrayBuffer.isView(obj)) {
765
+ return obj;
766
+ }
767
+
749
768
  const clean: Record<string, any> = {};
750
769
  for (const key of Object.keys(obj)) {
751
770
  const val = obj[key];
@@ -7,6 +7,7 @@ export type {
7
7
  } from "../api/EntityRegistry.js";
8
8
 
9
9
  export type {
10
+ EntityTypes,
10
11
  TransformsMap,
11
12
  TransformFunction,
12
13
  } from "./entities.js";
@@ -1,5 +1,5 @@
1
1
  export type { CollectionKey, EntityTag } from "../api/EntityRegistry.js";
2
- export type { TransformsMap, TransformFunction, } from "./entities.js";
2
+ export type { EntityTypes, TransformsMap, TransformFunction, } from "./entities.js";
3
3
  export type { SocialNetworkPayload, } from "./payloads.js";
4
4
  export type { UserTransforms, OrganizationTransforms, ProjectTransforms, EventTransforms } from "./transforms.js";
5
5
  export type { BaseApiResponse, ApiDataResponse, ApiErrorResponse, PaginatedApiResponse, GetElementsKeyResponse, ApiResponse } from "./api-responses.js";