Updated TS client to use proper types for deleteUsers (#2612)
This commit is contained in:
@@ -209,6 +209,11 @@ mode: "wide"
|
||||
|
||||
<Tab title="TypeScript">
|
||||
|
||||
<Update label="2025-05-02" description="v2.1.22">
|
||||
**New Features:**
|
||||
- **Client:** Updated `deleteUser` to use `entity_id` and `entity_type`
|
||||
</Update>
|
||||
|
||||
<Update label="2025-05-01" description="v2.1.21">
|
||||
**Improvements:**
|
||||
- **OSS SDK:** Bumped version of `@anthropic-ai/sdk` to `0.40.1`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mem0ai",
|
||||
"version": "2.1.21",
|
||||
"version": "2.1.22",
|
||||
"description": "The Memory Layer For Your AI Apps",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
|
||||
@@ -431,14 +431,17 @@ export default class MemoryClient {
|
||||
return response;
|
||||
}
|
||||
|
||||
async deleteUser(
|
||||
entityId: string,
|
||||
entity: { type: string } = { type: "user" },
|
||||
): Promise<{ message: string }> {
|
||||
async deleteUser(data: {
|
||||
entity_id: number;
|
||||
entity_type: string;
|
||||
}): Promise<{ message: string }> {
|
||||
if (this.telemetryId === "") await this.ping();
|
||||
this._captureEvent("delete_user", []);
|
||||
if (!data.entity_type) {
|
||||
data.entity_type = "user";
|
||||
}
|
||||
const response = await this._fetchWithErrorHandling(
|
||||
`${this.host}/v1/entities/${entity.type}/${entityId}/`,
|
||||
`${this.host}/v1/entities/${data.entity_type}/${data.entity_id}/`,
|
||||
{
|
||||
method: "DELETE",
|
||||
headers: this.headers,
|
||||
|
||||
Reference in New Issue
Block a user