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