@anuma/sdk 3.1.0 → 3.1.1
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/expo/{chunk-22CSPJLL.mjs → chunk-IP2B74KE.mjs} +15 -17
- package/dist/expo/index.cjs +21 -25
- package/dist/expo/index.mjs +8 -10
- package/dist/expo/{recall-LICO3TJ7.mjs → recall-NSSIYFNY.mjs} +1 -1
- package/dist/react/{chunk-FD5MB73N.mjs → chunk-XVC7DWDN.mjs} +15 -17
- package/dist/react/index.cjs +21 -25
- package/dist/react/index.mjs +8 -10
- package/dist/react/{recall-FPACUZGD.mjs → recall-VDP3H3QT.mjs} +1 -1
- package/dist/server/{chunk-RKUNGNBF.mjs → chunk-4GKKHVF7.mjs} +15 -17
- package/dist/server/index.cjs +21 -25
- package/dist/server/index.mjs +8 -10
- package/dist/server/{recall-WT5HY2IA.mjs → recall-KYSR3XZJ.mjs} +1 -1
- package/package.json +1 -1
|
@@ -2500,27 +2500,25 @@ async function stampTopicsExtractedAtOp(ctx, memoryIds, extractedAt, version = T
|
|
|
2500
2500
|
for (let i = 0; i < uniqueIds.length; i += CHUNK) {
|
|
2501
2501
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
2502
2502
|
await ctx.database.write(async () => {
|
|
2503
|
-
const
|
|
2503
|
+
const records = [];
|
|
2504
2504
|
for (const id of chunkIds) {
|
|
2505
|
-
let record;
|
|
2506
2505
|
try {
|
|
2507
|
-
|
|
2506
|
+
records.push(await ctx.vaultMemoryCollection.find(id));
|
|
2508
2507
|
} catch {
|
|
2509
|
-
continue;
|
|
2510
|
-
}
|
|
2511
|
-
if (record.isDeleted || !isOwnedByCtxUser(ctx, record) || record.topicsUserManaged) {
|
|
2512
|
-
continue;
|
|
2513
2508
|
}
|
|
2514
|
-
const originalUpdatedAt = record.updatedAt.getTime();
|
|
2515
|
-
prepared.push(
|
|
2516
|
-
record.prepareUpdate((r) => {
|
|
2517
|
-
r._setRaw("topics_extracted_at", extractedAt);
|
|
2518
|
-
r._setRaw("topics_extracted_version", version);
|
|
2519
|
-
r._setRaw("updated_at", originalUpdatedAt);
|
|
2520
|
-
})
|
|
2521
|
-
);
|
|
2522
|
-
stamped.push(id);
|
|
2523
2509
|
}
|
|
2510
|
+
const eligible = records.filter(
|
|
2511
|
+
(record) => !record.isDeleted && isOwnedByCtxUser(ctx, record) && !record.topicsUserManaged
|
|
2512
|
+
);
|
|
2513
|
+
const prepared = eligible.map((record) => {
|
|
2514
|
+
const originalUpdatedAt = record.updatedAt.getTime();
|
|
2515
|
+
return record.prepareUpdate((r) => {
|
|
2516
|
+
r._setRaw("topics_extracted_at", extractedAt);
|
|
2517
|
+
r._setRaw("topics_extracted_version", version);
|
|
2518
|
+
r._setRaw("updated_at", originalUpdatedAt);
|
|
2519
|
+
});
|
|
2520
|
+
});
|
|
2521
|
+
for (const record of eligible) stamped.push(record.id);
|
|
2524
2522
|
if (prepared.length > 0) await ctx.database.batch(...prepared);
|
|
2525
2523
|
});
|
|
2526
2524
|
}
|
|
@@ -4324,7 +4322,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
|
|
|
4324
4322
|
legacy.map((r) => ({ id: r.uniqueId, content: r.content, score: r.similarity }))
|
|
4325
4323
|
);
|
|
4326
4324
|
}
|
|
4327
|
-
const { recall: recall2 } = await import("./recall-
|
|
4325
|
+
const { recall: recall2 } = await import("./recall-NSSIYFNY.mjs");
|
|
4328
4326
|
const result = await recall2(
|
|
4329
4327
|
query,
|
|
4330
4328
|
{ vaultCtx, embeddingOptions, vaultCache: cache },
|
package/dist/expo/index.cjs
CHANGED
|
@@ -3849,27 +3849,25 @@ async function stampTopicsExtractedAtOp(ctx, memoryIds, extractedAt, version = T
|
|
|
3849
3849
|
for (let i = 0; i < uniqueIds.length; i += CHUNK) {
|
|
3850
3850
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
3851
3851
|
await ctx.database.write(async () => {
|
|
3852
|
-
const
|
|
3852
|
+
const records = [];
|
|
3853
3853
|
for (const id of chunkIds) {
|
|
3854
|
-
let record;
|
|
3855
3854
|
try {
|
|
3856
|
-
|
|
3855
|
+
records.push(await ctx.vaultMemoryCollection.find(id));
|
|
3857
3856
|
} catch {
|
|
3858
|
-
continue;
|
|
3859
|
-
}
|
|
3860
|
-
if (record.isDeleted || !isOwnedByCtxUser(ctx, record) || record.topicsUserManaged) {
|
|
3861
|
-
continue;
|
|
3862
3857
|
}
|
|
3863
|
-
const originalUpdatedAt = record.updatedAt.getTime();
|
|
3864
|
-
prepared.push(
|
|
3865
|
-
record.prepareUpdate((r) => {
|
|
3866
|
-
r._setRaw("topics_extracted_at", extractedAt);
|
|
3867
|
-
r._setRaw("topics_extracted_version", version);
|
|
3868
|
-
r._setRaw("updated_at", originalUpdatedAt);
|
|
3869
|
-
})
|
|
3870
|
-
);
|
|
3871
|
-
stamped.push(id);
|
|
3872
3858
|
}
|
|
3859
|
+
const eligible = records.filter(
|
|
3860
|
+
(record) => !record.isDeleted && isOwnedByCtxUser(ctx, record) && !record.topicsUserManaged
|
|
3861
|
+
);
|
|
3862
|
+
const prepared = eligible.map((record) => {
|
|
3863
|
+
const originalUpdatedAt = record.updatedAt.getTime();
|
|
3864
|
+
return record.prepareUpdate((r) => {
|
|
3865
|
+
r._setRaw("topics_extracted_at", extractedAt);
|
|
3866
|
+
r._setRaw("topics_extracted_version", version);
|
|
3867
|
+
r._setRaw("updated_at", originalUpdatedAt);
|
|
3868
|
+
});
|
|
3869
|
+
});
|
|
3870
|
+
for (const record of eligible) stamped.push(record.id);
|
|
3873
3871
|
if (prepared.length > 0) await ctx.database.batch(...prepared);
|
|
3874
3872
|
});
|
|
3875
3873
|
}
|
|
@@ -18562,6 +18560,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
18562
18560
|
if (record.isDeleted) return null;
|
|
18563
18561
|
const scopeChanged = opts.scope !== void 0 && opts.scope !== record.scope;
|
|
18564
18562
|
const updated = await ctx.database.write(async () => {
|
|
18563
|
+
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(import_watermelondb22.Q.where("folder_id", id), import_watermelondb22.Q.where("is_deleted", false)).fetch() : [];
|
|
18565
18564
|
const updates = [];
|
|
18566
18565
|
updates.push(
|
|
18567
18566
|
record.prepareUpdate((r) => {
|
|
@@ -18569,15 +18568,12 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
18569
18568
|
if (opts.scope !== void 0) r._setRaw("scope", opts.scope);
|
|
18570
18569
|
})
|
|
18571
18570
|
);
|
|
18572
|
-
|
|
18573
|
-
|
|
18574
|
-
|
|
18575
|
-
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
})
|
|
18579
|
-
);
|
|
18580
|
-
}
|
|
18571
|
+
for (const memory of memories) {
|
|
18572
|
+
updates.push(
|
|
18573
|
+
memory.prepareUpdate((r) => {
|
|
18574
|
+
r._setRaw("scope", opts.scope);
|
|
18575
|
+
})
|
|
18576
|
+
);
|
|
18581
18577
|
}
|
|
18582
18578
|
await ctx.database.batch(...updates);
|
|
18583
18579
|
return ctx.vaultFolderCollection.find(id);
|
package/dist/expo/index.mjs
CHANGED
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
upsertMessageOp,
|
|
88
88
|
useEncryption,
|
|
89
89
|
vaultMemoryToStored
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-IP2B74KE.mjs";
|
|
91
91
|
import {
|
|
92
92
|
PII_PATTERNS,
|
|
93
93
|
PiiRedactor,
|
|
@@ -12154,6 +12154,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
12154
12154
|
if (record.isDeleted) return null;
|
|
12155
12155
|
const scopeChanged = opts.scope !== void 0 && opts.scope !== record.scope;
|
|
12156
12156
|
const updated = await ctx.database.write(async () => {
|
|
12157
|
+
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(Q5.where("folder_id", id), Q5.where("is_deleted", false)).fetch() : [];
|
|
12157
12158
|
const updates = [];
|
|
12158
12159
|
updates.push(
|
|
12159
12160
|
record.prepareUpdate((r) => {
|
|
@@ -12161,15 +12162,12 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
12161
12162
|
if (opts.scope !== void 0) r._setRaw("scope", opts.scope);
|
|
12162
12163
|
})
|
|
12163
12164
|
);
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
})
|
|
12171
|
-
);
|
|
12172
|
-
}
|
|
12165
|
+
for (const memory of memories) {
|
|
12166
|
+
updates.push(
|
|
12167
|
+
memory.prepareUpdate((r) => {
|
|
12168
|
+
r._setRaw("scope", opts.scope);
|
|
12169
|
+
})
|
|
12170
|
+
);
|
|
12173
12171
|
}
|
|
12174
12172
|
await ctx.database.batch(...updates);
|
|
12175
12173
|
return ctx.vaultFolderCollection.find(id);
|
|
@@ -2707,27 +2707,25 @@ async function stampTopicsExtractedAtOp(ctx, memoryIds, extractedAt, version = T
|
|
|
2707
2707
|
for (let i = 0; i < uniqueIds.length; i += CHUNK) {
|
|
2708
2708
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
2709
2709
|
await ctx.database.write(async () => {
|
|
2710
|
-
const
|
|
2710
|
+
const records = [];
|
|
2711
2711
|
for (const id of chunkIds) {
|
|
2712
|
-
let record;
|
|
2713
2712
|
try {
|
|
2714
|
-
|
|
2713
|
+
records.push(await ctx.vaultMemoryCollection.find(id));
|
|
2715
2714
|
} catch {
|
|
2716
|
-
continue;
|
|
2717
|
-
}
|
|
2718
|
-
if (record.isDeleted || !isOwnedByCtxUser(ctx, record) || record.topicsUserManaged) {
|
|
2719
|
-
continue;
|
|
2720
2715
|
}
|
|
2721
|
-
const originalUpdatedAt = record.updatedAt.getTime();
|
|
2722
|
-
prepared.push(
|
|
2723
|
-
record.prepareUpdate((r) => {
|
|
2724
|
-
r._setRaw("topics_extracted_at", extractedAt);
|
|
2725
|
-
r._setRaw("topics_extracted_version", version);
|
|
2726
|
-
r._setRaw("updated_at", originalUpdatedAt);
|
|
2727
|
-
})
|
|
2728
|
-
);
|
|
2729
|
-
stamped.push(id);
|
|
2730
2716
|
}
|
|
2717
|
+
const eligible = records.filter(
|
|
2718
|
+
(record) => !record.isDeleted && isOwnedByCtxUser(ctx, record) && !record.topicsUserManaged
|
|
2719
|
+
);
|
|
2720
|
+
const prepared = eligible.map((record) => {
|
|
2721
|
+
const originalUpdatedAt = record.updatedAt.getTime();
|
|
2722
|
+
return record.prepareUpdate((r) => {
|
|
2723
|
+
r._setRaw("topics_extracted_at", extractedAt);
|
|
2724
|
+
r._setRaw("topics_extracted_version", version);
|
|
2725
|
+
r._setRaw("updated_at", originalUpdatedAt);
|
|
2726
|
+
});
|
|
2727
|
+
});
|
|
2728
|
+
for (const record of eligible) stamped.push(record.id);
|
|
2731
2729
|
if (prepared.length > 0) await ctx.database.batch(...prepared);
|
|
2732
2730
|
});
|
|
2733
2731
|
}
|
|
@@ -4531,7 +4529,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
|
|
|
4531
4529
|
legacy.map((r) => ({ id: r.uniqueId, content: r.content, score: r.similarity }))
|
|
4532
4530
|
);
|
|
4533
4531
|
}
|
|
4534
|
-
const { recall: recall2 } = await import("./recall-
|
|
4532
|
+
const { recall: recall2 } = await import("./recall-VDP3H3QT.mjs");
|
|
4535
4533
|
const result = await recall2(
|
|
4536
4534
|
query,
|
|
4537
4535
|
{ vaultCtx, embeddingOptions, vaultCache: cache },
|
package/dist/react/index.cjs
CHANGED
|
@@ -4056,27 +4056,25 @@ async function stampTopicsExtractedAtOp(ctx, memoryIds, extractedAt, version = T
|
|
|
4056
4056
|
for (let i = 0; i < uniqueIds.length; i += CHUNK) {
|
|
4057
4057
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
4058
4058
|
await ctx.database.write(async () => {
|
|
4059
|
-
const
|
|
4059
|
+
const records = [];
|
|
4060
4060
|
for (const id of chunkIds) {
|
|
4061
|
-
let record;
|
|
4062
4061
|
try {
|
|
4063
|
-
|
|
4062
|
+
records.push(await ctx.vaultMemoryCollection.find(id));
|
|
4064
4063
|
} catch {
|
|
4065
|
-
continue;
|
|
4066
|
-
}
|
|
4067
|
-
if (record.isDeleted || !isOwnedByCtxUser(ctx, record) || record.topicsUserManaged) {
|
|
4068
|
-
continue;
|
|
4069
4064
|
}
|
|
4070
|
-
const originalUpdatedAt = record.updatedAt.getTime();
|
|
4071
|
-
prepared.push(
|
|
4072
|
-
record.prepareUpdate((r) => {
|
|
4073
|
-
r._setRaw("topics_extracted_at", extractedAt);
|
|
4074
|
-
r._setRaw("topics_extracted_version", version);
|
|
4075
|
-
r._setRaw("updated_at", originalUpdatedAt);
|
|
4076
|
-
})
|
|
4077
|
-
);
|
|
4078
|
-
stamped.push(id);
|
|
4079
4065
|
}
|
|
4066
|
+
const eligible = records.filter(
|
|
4067
|
+
(record) => !record.isDeleted && isOwnedByCtxUser(ctx, record) && !record.topicsUserManaged
|
|
4068
|
+
);
|
|
4069
|
+
const prepared = eligible.map((record) => {
|
|
4070
|
+
const originalUpdatedAt = record.updatedAt.getTime();
|
|
4071
|
+
return record.prepareUpdate((r) => {
|
|
4072
|
+
r._setRaw("topics_extracted_at", extractedAt);
|
|
4073
|
+
r._setRaw("topics_extracted_version", version);
|
|
4074
|
+
r._setRaw("updated_at", originalUpdatedAt);
|
|
4075
|
+
});
|
|
4076
|
+
});
|
|
4077
|
+
for (const record of eligible) stamped.push(record.id);
|
|
4080
4078
|
if (prepared.length > 0) await ctx.database.batch(...prepared);
|
|
4081
4079
|
});
|
|
4082
4080
|
}
|
|
@@ -21098,6 +21096,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
21098
21096
|
if (record.isDeleted) return null;
|
|
21099
21097
|
const scopeChanged = opts.scope !== void 0 && opts.scope !== record.scope;
|
|
21100
21098
|
const updated = await ctx.database.write(async () => {
|
|
21099
|
+
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(import_watermelondb27.Q.where("folder_id", id), import_watermelondb27.Q.where("is_deleted", false)).fetch() : [];
|
|
21101
21100
|
const updates = [];
|
|
21102
21101
|
updates.push(
|
|
21103
21102
|
record.prepareUpdate((r) => {
|
|
@@ -21105,15 +21104,12 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
21105
21104
|
if (opts.scope !== void 0) r._setRaw("scope", opts.scope);
|
|
21106
21105
|
})
|
|
21107
21106
|
);
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
|
|
21112
|
-
|
|
21113
|
-
|
|
21114
|
-
})
|
|
21115
|
-
);
|
|
21116
|
-
}
|
|
21107
|
+
for (const memory of memories) {
|
|
21108
|
+
updates.push(
|
|
21109
|
+
memory.prepareUpdate((r) => {
|
|
21110
|
+
r._setRaw("scope", opts.scope);
|
|
21111
|
+
})
|
|
21112
|
+
);
|
|
21117
21113
|
}
|
|
21118
21114
|
await ctx.database.batch(...updates);
|
|
21119
21115
|
return ctx.vaultFolderCollection.find(id);
|
package/dist/react/index.mjs
CHANGED
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
updateVaultMemoryOp,
|
|
113
113
|
useEncryption,
|
|
114
114
|
vaultMemoryToStored
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-XVC7DWDN.mjs";
|
|
116
116
|
import {
|
|
117
117
|
PiiRedactor,
|
|
118
118
|
createStreamingDeAnonymizer,
|
|
@@ -14257,6 +14257,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
14257
14257
|
if (record.isDeleted) return null;
|
|
14258
14258
|
const scopeChanged = opts.scope !== void 0 && opts.scope !== record.scope;
|
|
14259
14259
|
const updated = await ctx.database.write(async () => {
|
|
14260
|
+
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(Q9.where("folder_id", id), Q9.where("is_deleted", false)).fetch() : [];
|
|
14260
14261
|
const updates = [];
|
|
14261
14262
|
updates.push(
|
|
14262
14263
|
record.prepareUpdate((r) => {
|
|
@@ -14264,15 +14265,12 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
14264
14265
|
if (opts.scope !== void 0) r._setRaw("scope", opts.scope);
|
|
14265
14266
|
})
|
|
14266
14267
|
);
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
})
|
|
14274
|
-
);
|
|
14275
|
-
}
|
|
14268
|
+
for (const memory of memories) {
|
|
14269
|
+
updates.push(
|
|
14270
|
+
memory.prepareUpdate((r) => {
|
|
14271
|
+
r._setRaw("scope", opts.scope);
|
|
14272
|
+
})
|
|
14273
|
+
);
|
|
14276
14274
|
}
|
|
14277
14275
|
await ctx.database.batch(...updates);
|
|
14278
14276
|
return ctx.vaultFolderCollection.find(id);
|
|
@@ -16702,27 +16702,25 @@ async function stampTopicsExtractedAtOp(ctx, memoryIds, extractedAt, version = T
|
|
|
16702
16702
|
for (let i = 0; i < uniqueIds.length; i += CHUNK) {
|
|
16703
16703
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
16704
16704
|
await ctx.database.write(async () => {
|
|
16705
|
-
const
|
|
16705
|
+
const records = [];
|
|
16706
16706
|
for (const id of chunkIds) {
|
|
16707
|
-
let record;
|
|
16708
16707
|
try {
|
|
16709
|
-
|
|
16708
|
+
records.push(await ctx.vaultMemoryCollection.find(id));
|
|
16710
16709
|
} catch {
|
|
16711
|
-
continue;
|
|
16712
|
-
}
|
|
16713
|
-
if (record.isDeleted || !isOwnedByCtxUser(ctx, record) || record.topicsUserManaged) {
|
|
16714
|
-
continue;
|
|
16715
16710
|
}
|
|
16716
|
-
const originalUpdatedAt = record.updatedAt.getTime();
|
|
16717
|
-
prepared.push(
|
|
16718
|
-
record.prepareUpdate((r) => {
|
|
16719
|
-
r._setRaw("topics_extracted_at", extractedAt);
|
|
16720
|
-
r._setRaw("topics_extracted_version", version);
|
|
16721
|
-
r._setRaw("updated_at", originalUpdatedAt);
|
|
16722
|
-
})
|
|
16723
|
-
);
|
|
16724
|
-
stamped.push(id);
|
|
16725
16711
|
}
|
|
16712
|
+
const eligible = records.filter(
|
|
16713
|
+
(record) => !record.isDeleted && isOwnedByCtxUser(ctx, record) && !record.topicsUserManaged
|
|
16714
|
+
);
|
|
16715
|
+
const prepared = eligible.map((record) => {
|
|
16716
|
+
const originalUpdatedAt = record.updatedAt.getTime();
|
|
16717
|
+
return record.prepareUpdate((r) => {
|
|
16718
|
+
r._setRaw("topics_extracted_at", extractedAt);
|
|
16719
|
+
r._setRaw("topics_extracted_version", version);
|
|
16720
|
+
r._setRaw("updated_at", originalUpdatedAt);
|
|
16721
|
+
});
|
|
16722
|
+
});
|
|
16723
|
+
for (const record of eligible) stamped.push(record.id);
|
|
16726
16724
|
if (prepared.length > 0) await ctx.database.batch(...prepared);
|
|
16727
16725
|
});
|
|
16728
16726
|
}
|
|
@@ -18526,7 +18524,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
|
|
|
18526
18524
|
legacy.map((r) => ({ id: r.uniqueId, content: r.content, score: r.similarity }))
|
|
18527
18525
|
);
|
|
18528
18526
|
}
|
|
18529
|
-
const { recall: recall2 } = await import("./recall-
|
|
18527
|
+
const { recall: recall2 } = await import("./recall-KYSR3XZJ.mjs");
|
|
18530
18528
|
const result = await recall2(
|
|
18531
18529
|
query,
|
|
18532
18530
|
{ vaultCtx, embeddingOptions, vaultCache: cache },
|
package/dist/server/index.cjs
CHANGED
|
@@ -17509,27 +17509,25 @@ async function stampTopicsExtractedAtOp(ctx, memoryIds, extractedAt, version = T
|
|
|
17509
17509
|
for (let i = 0; i < uniqueIds.length; i += CHUNK) {
|
|
17510
17510
|
const chunkIds = uniqueIds.slice(i, i + CHUNK);
|
|
17511
17511
|
await ctx.database.write(async () => {
|
|
17512
|
-
const
|
|
17512
|
+
const records = [];
|
|
17513
17513
|
for (const id of chunkIds) {
|
|
17514
|
-
let record;
|
|
17515
17514
|
try {
|
|
17516
|
-
|
|
17515
|
+
records.push(await ctx.vaultMemoryCollection.find(id));
|
|
17517
17516
|
} catch {
|
|
17518
|
-
continue;
|
|
17519
|
-
}
|
|
17520
|
-
if (record.isDeleted || !isOwnedByCtxUser(ctx, record) || record.topicsUserManaged) {
|
|
17521
|
-
continue;
|
|
17522
17517
|
}
|
|
17523
|
-
const originalUpdatedAt = record.updatedAt.getTime();
|
|
17524
|
-
prepared.push(
|
|
17525
|
-
record.prepareUpdate((r) => {
|
|
17526
|
-
r._setRaw("topics_extracted_at", extractedAt);
|
|
17527
|
-
r._setRaw("topics_extracted_version", version);
|
|
17528
|
-
r._setRaw("updated_at", originalUpdatedAt);
|
|
17529
|
-
})
|
|
17530
|
-
);
|
|
17531
|
-
stamped.push(id);
|
|
17532
17518
|
}
|
|
17519
|
+
const eligible = records.filter(
|
|
17520
|
+
(record) => !record.isDeleted && isOwnedByCtxUser(ctx, record) && !record.topicsUserManaged
|
|
17521
|
+
);
|
|
17522
|
+
const prepared = eligible.map((record) => {
|
|
17523
|
+
const originalUpdatedAt = record.updatedAt.getTime();
|
|
17524
|
+
return record.prepareUpdate((r) => {
|
|
17525
|
+
r._setRaw("topics_extracted_at", extractedAt);
|
|
17526
|
+
r._setRaw("topics_extracted_version", version);
|
|
17527
|
+
r._setRaw("updated_at", originalUpdatedAt);
|
|
17528
|
+
});
|
|
17529
|
+
});
|
|
17530
|
+
for (const record of eligible) stamped.push(record.id);
|
|
17533
17531
|
if (prepared.length > 0) await ctx.database.batch(...prepared);
|
|
17534
17532
|
});
|
|
17535
17533
|
}
|
|
@@ -23947,6 +23945,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
23947
23945
|
if (record.isDeleted) return null;
|
|
23948
23946
|
const scopeChanged = opts.scope !== void 0 && opts.scope !== record.scope;
|
|
23949
23947
|
const updated = await ctx.database.write(async () => {
|
|
23948
|
+
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(import_watermelondb18.Q.where("folder_id", id), import_watermelondb18.Q.where("is_deleted", false)).fetch() : [];
|
|
23950
23949
|
const updates = [];
|
|
23951
23950
|
updates.push(
|
|
23952
23951
|
record.prepareUpdate((r) => {
|
|
@@ -23954,15 +23953,12 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
23954
23953
|
if (opts.scope !== void 0) r._setRaw("scope", opts.scope);
|
|
23955
23954
|
})
|
|
23956
23955
|
);
|
|
23957
|
-
|
|
23958
|
-
|
|
23959
|
-
|
|
23960
|
-
|
|
23961
|
-
|
|
23962
|
-
|
|
23963
|
-
})
|
|
23964
|
-
);
|
|
23965
|
-
}
|
|
23956
|
+
for (const memory of memories) {
|
|
23957
|
+
updates.push(
|
|
23958
|
+
memory.prepareUpdate((r) => {
|
|
23959
|
+
r._setRaw("scope", opts.scope);
|
|
23960
|
+
})
|
|
23961
|
+
);
|
|
23966
23962
|
}
|
|
23967
23963
|
await ctx.database.batch(...updates);
|
|
23968
23964
|
return ctx.vaultFolderCollection.find(id);
|
package/dist/server/index.mjs
CHANGED
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
updateVaultMemoryOp,
|
|
108
108
|
upsertMessageOp,
|
|
109
109
|
vaultMemoryToStored
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-4GKKHVF7.mjs";
|
|
111
111
|
import {
|
|
112
112
|
createStreamingDeAnonymizer,
|
|
113
113
|
resolvePiiRedactor
|
|
@@ -3347,6 +3347,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
3347
3347
|
if (record.isDeleted) return null;
|
|
3348
3348
|
const scopeChanged = opts.scope !== void 0 && opts.scope !== record.scope;
|
|
3349
3349
|
const updated = await ctx.database.write(async () => {
|
|
3350
|
+
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(import_watermelondb15.Q.where("folder_id", id), import_watermelondb15.Q.where("is_deleted", false)).fetch() : [];
|
|
3350
3351
|
const updates = [];
|
|
3351
3352
|
updates.push(
|
|
3352
3353
|
record.prepareUpdate((r) => {
|
|
@@ -3354,15 +3355,12 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
3354
3355
|
if (opts.scope !== void 0) r._setRaw("scope", opts.scope);
|
|
3355
3356
|
})
|
|
3356
3357
|
);
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
})
|
|
3364
|
-
);
|
|
3365
|
-
}
|
|
3358
|
+
for (const memory of memories) {
|
|
3359
|
+
updates.push(
|
|
3360
|
+
memory.prepareUpdate((r) => {
|
|
3361
|
+
r._setRaw("scope", opts.scope);
|
|
3362
|
+
})
|
|
3363
|
+
);
|
|
3366
3364
|
}
|
|
3367
3365
|
await ctx.database.batch(...updates);
|
|
3368
3366
|
return ctx.vaultFolderCollection.find(id);
|