memorysync-sdk 1.7.0 → 1.7.2
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/index.d.mts +28 -4
- package/dist/index.d.ts +28 -4
- package/dist/index.js +27 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -951,7 +951,13 @@ interface BatchUpdateResponse {
|
|
|
951
951
|
* Criteria for a filter-based delete.
|
|
952
952
|
*
|
|
953
953
|
* At least one field must be set — an all-empty filter would mean "delete
|
|
954
|
-
* everything I own", which has to be
|
|
954
|
+
* everything I own", which has to be asked for explicitly rather than being the
|
|
955
|
+
* result of omitting a field.
|
|
956
|
+
*
|
|
957
|
+
* To clear everything for an end user, say so with a wide criterion such as
|
|
958
|
+
* `{ before: new Date() }`. Not `purgeUser()`: an earlier version of this
|
|
959
|
+
* comment pointed there, and it erases the account rather than its memories.
|
|
960
|
+
*
|
|
955
961
|
* `tags` matches memories carrying **all** the listed tags, not any of them.
|
|
956
962
|
*/
|
|
957
963
|
interface ForgetFilters {
|
|
@@ -1096,10 +1102,28 @@ declare class MemorySyncClient {
|
|
|
1096
1102
|
forget(request: ForgetRequest): Promise<number[]>;
|
|
1097
1103
|
forget(memoryIds: number[], reason?: string): Promise<number[]>;
|
|
1098
1104
|
/**
|
|
1099
|
-
*
|
|
1105
|
+
* Not a memory operation, and not callable from this SDK. Always throws.
|
|
1106
|
+
*
|
|
1107
|
+
* `DELETE /memory/user/purge` reads as if it clears one end user's memories.
|
|
1108
|
+
* It does neither. It ignores `endUserId` and erases the **account** behind
|
|
1109
|
+
* the credential, cascading to the password hash, every API key, memberships,
|
|
1110
|
+
* auth providers and MFA credentials. Nobody can sign in afterwards, and the
|
|
1111
|
+
* API cannot repair it, because the credential that would authorise a repair
|
|
1112
|
+
* is one of the things it destroys.
|
|
1113
|
+
*
|
|
1114
|
+
* Earlier versions of this method described it as "delete every memory
|
|
1115
|
+
* belonging to the calling end user", and callers who believed that lost
|
|
1116
|
+
* accounts.
|
|
1117
|
+
*
|
|
1118
|
+
* The server now refuses account erasure for every API-key caller, and this
|
|
1119
|
+
* client authenticates only with an API key, so the call could never succeed.
|
|
1120
|
+
* It throws locally rather than sending a request that can only come back 403,
|
|
1121
|
+
* so the reason arrives immediately and no destructive intent leaves the
|
|
1122
|
+
* process. Erase an account from the dashboard, where a human is present.
|
|
1100
1123
|
*
|
|
1101
|
-
*
|
|
1102
|
-
*
|
|
1124
|
+
* @deprecated Use {@link forget} for anything memory-related: by ids, or with
|
|
1125
|
+
* a wide criterion such as `{ before: new Date() }` to clear an end user.
|
|
1126
|
+
* @throws {ValidationError} Always.
|
|
1103
1127
|
*/
|
|
1104
1128
|
purgeUser(): Promise<Record<string, unknown>>;
|
|
1105
1129
|
summarize(req: SummarizeRequest): Promise<MemoryRecord>;
|
package/dist/index.d.ts
CHANGED
|
@@ -951,7 +951,13 @@ interface BatchUpdateResponse {
|
|
|
951
951
|
* Criteria for a filter-based delete.
|
|
952
952
|
*
|
|
953
953
|
* At least one field must be set — an all-empty filter would mean "delete
|
|
954
|
-
* everything I own", which has to be
|
|
954
|
+
* everything I own", which has to be asked for explicitly rather than being the
|
|
955
|
+
* result of omitting a field.
|
|
956
|
+
*
|
|
957
|
+
* To clear everything for an end user, say so with a wide criterion such as
|
|
958
|
+
* `{ before: new Date() }`. Not `purgeUser()`: an earlier version of this
|
|
959
|
+
* comment pointed there, and it erases the account rather than its memories.
|
|
960
|
+
*
|
|
955
961
|
* `tags` matches memories carrying **all** the listed tags, not any of them.
|
|
956
962
|
*/
|
|
957
963
|
interface ForgetFilters {
|
|
@@ -1096,10 +1102,28 @@ declare class MemorySyncClient {
|
|
|
1096
1102
|
forget(request: ForgetRequest): Promise<number[]>;
|
|
1097
1103
|
forget(memoryIds: number[], reason?: string): Promise<number[]>;
|
|
1098
1104
|
/**
|
|
1099
|
-
*
|
|
1105
|
+
* Not a memory operation, and not callable from this SDK. Always throws.
|
|
1106
|
+
*
|
|
1107
|
+
* `DELETE /memory/user/purge` reads as if it clears one end user's memories.
|
|
1108
|
+
* It does neither. It ignores `endUserId` and erases the **account** behind
|
|
1109
|
+
* the credential, cascading to the password hash, every API key, memberships,
|
|
1110
|
+
* auth providers and MFA credentials. Nobody can sign in afterwards, and the
|
|
1111
|
+
* API cannot repair it, because the credential that would authorise a repair
|
|
1112
|
+
* is one of the things it destroys.
|
|
1113
|
+
*
|
|
1114
|
+
* Earlier versions of this method described it as "delete every memory
|
|
1115
|
+
* belonging to the calling end user", and callers who believed that lost
|
|
1116
|
+
* accounts.
|
|
1117
|
+
*
|
|
1118
|
+
* The server now refuses account erasure for every API-key caller, and this
|
|
1119
|
+
* client authenticates only with an API key, so the call could never succeed.
|
|
1120
|
+
* It throws locally rather than sending a request that can only come back 403,
|
|
1121
|
+
* so the reason arrives immediately and no destructive intent leaves the
|
|
1122
|
+
* process. Erase an account from the dashboard, where a human is present.
|
|
1100
1123
|
*
|
|
1101
|
-
*
|
|
1102
|
-
*
|
|
1124
|
+
* @deprecated Use {@link forget} for anything memory-related: by ids, or with
|
|
1125
|
+
* a wide criterion such as `{ before: new Date() }` to clear an end user.
|
|
1126
|
+
* @throws {ValidationError} Always.
|
|
1103
1127
|
*/
|
|
1104
1128
|
purgeUser(): Promise<Record<string, unknown>>;
|
|
1105
1129
|
summarize(req: SummarizeRequest): Promise<MemoryRecord>;
|
package/dist/index.js
CHANGED
|
@@ -576,7 +576,7 @@ var IntegrationsNamespace = class extends Namespace {
|
|
|
576
576
|
};
|
|
577
577
|
|
|
578
578
|
// src/control-plane.ts
|
|
579
|
-
var SDK_VERSION = "1.7.
|
|
579
|
+
var SDK_VERSION = "1.7.2";
|
|
580
580
|
function safeJson(text) {
|
|
581
581
|
try {
|
|
582
582
|
return JSON.parse(text);
|
|
@@ -1132,7 +1132,7 @@ var ControlPlaneClient = class {
|
|
|
1132
1132
|
};
|
|
1133
1133
|
|
|
1134
1134
|
// src/index.ts
|
|
1135
|
-
var SDK_VERSION2 = "1.7.
|
|
1135
|
+
var SDK_VERSION2 = "1.7.2";
|
|
1136
1136
|
function camelToSnakeKey(key) {
|
|
1137
1137
|
return key.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
1138
1138
|
}
|
|
@@ -1409,7 +1409,7 @@ var MemorySyncClient = class {
|
|
|
1409
1409
|
if (f.after !== void 0) filters.after = f.after;
|
|
1410
1410
|
if (Object.keys(filters).length === 0) {
|
|
1411
1411
|
throw new ValidationError(
|
|
1412
|
-
"filters must set at least one criterion;
|
|
1412
|
+
"filters must set at least one criterion; to remove everything for an end user use a wide criterion such as { before: new Date() }"
|
|
1413
1413
|
);
|
|
1414
1414
|
}
|
|
1415
1415
|
body.filters = filters;
|
|
@@ -1419,13 +1419,33 @@ var MemorySyncClient = class {
|
|
|
1419
1419
|
return await this.request("DELETE", "/memory/forget", { body });
|
|
1420
1420
|
}
|
|
1421
1421
|
/**
|
|
1422
|
-
*
|
|
1422
|
+
* Not a memory operation, and not callable from this SDK. Always throws.
|
|
1423
1423
|
*
|
|
1424
|
-
*
|
|
1425
|
-
*
|
|
1424
|
+
* `DELETE /memory/user/purge` reads as if it clears one end user's memories.
|
|
1425
|
+
* It does neither. It ignores `endUserId` and erases the **account** behind
|
|
1426
|
+
* the credential, cascading to the password hash, every API key, memberships,
|
|
1427
|
+
* auth providers and MFA credentials. Nobody can sign in afterwards, and the
|
|
1428
|
+
* API cannot repair it, because the credential that would authorise a repair
|
|
1429
|
+
* is one of the things it destroys.
|
|
1430
|
+
*
|
|
1431
|
+
* Earlier versions of this method described it as "delete every memory
|
|
1432
|
+
* belonging to the calling end user", and callers who believed that lost
|
|
1433
|
+
* accounts.
|
|
1434
|
+
*
|
|
1435
|
+
* The server now refuses account erasure for every API-key caller, and this
|
|
1436
|
+
* client authenticates only with an API key, so the call could never succeed.
|
|
1437
|
+
* It throws locally rather than sending a request that can only come back 403,
|
|
1438
|
+
* so the reason arrives immediately and no destructive intent leaves the
|
|
1439
|
+
* process. Erase an account from the dashboard, where a human is present.
|
|
1440
|
+
*
|
|
1441
|
+
* @deprecated Use {@link forget} for anything memory-related: by ids, or with
|
|
1442
|
+
* a wide criterion such as `{ before: new Date() }` to clear an end user.
|
|
1443
|
+
* @throws {ValidationError} Always.
|
|
1426
1444
|
*/
|
|
1427
1445
|
async purgeUser() {
|
|
1428
|
-
|
|
1446
|
+
throw new ValidationError(
|
|
1447
|
+
"purgeUser() erases the whole account, not its memories: the password hash, every API key and all sign-in credentials go with it. The API refuses this for API-key callers, and this client only supports API keys, so the call cannot succeed. To delete memories use forget(), either with ids or a wide criterion such as { before: new Date() }. To close an account, use the dashboard."
|
|
1448
|
+
);
|
|
1429
1449
|
}
|
|
1430
1450
|
async summarize(req) {
|
|
1431
1451
|
if (!req.memoryIds || req.memoryIds.length === 0) {
|