@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/dist/cocolight-api-client.browser.js +1 -1
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +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/src/api/BaseEntity.ts +19 -0
- package/src/types/index.ts +1 -0
- package/types/types/index.d.ts +1 -1
package/package.json
CHANGED
package/src/api/BaseEntity.ts
CHANGED
|
@@ -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];
|
package/src/types/index.ts
CHANGED
package/types/types/index.d.ts
CHANGED
|
@@ -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";
|