applesauce-core 0.0.0-next-20250313155042 → 0.0.0-next-20250313225050
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.
|
@@ -44,3 +44,5 @@ export type HiddenContentEvent = {
|
|
|
44
44
|
* @throws
|
|
45
45
|
*/
|
|
46
46
|
export declare function unlockHiddenContent<T extends HiddenContentEvent>(event: T, signer: HiddenContentSigner): Promise<string>;
|
|
47
|
+
/** Removes the unencrypted hidden content on an event */
|
|
48
|
+
export declare function lockHiddenContent<T extends object>(event: T): void;
|
|
@@ -76,3 +76,13 @@ export async function unlockHiddenContent(event, signer) {
|
|
|
76
76
|
}
|
|
77
77
|
return plaintext;
|
|
78
78
|
}
|
|
79
|
+
/** Removes the unencrypted hidden content on an event */
|
|
80
|
+
export function lockHiddenContent(event) {
|
|
81
|
+
Reflect.deleteProperty(event, HiddenContentSymbol);
|
|
82
|
+
// if the event has been added to an event store, notify it
|
|
83
|
+
if (isEvent(event)) {
|
|
84
|
+
const eventStore = getParentEventStore(event);
|
|
85
|
+
if (eventStore)
|
|
86
|
+
eventStore.update(event);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -27,3 +27,4 @@ export declare function getHiddenTagsEncryptionMethods(kind: number, signer: Hid
|
|
|
27
27
|
* @throws
|
|
28
28
|
*/
|
|
29
29
|
export declare function unlockHiddenTags<T extends HiddenContentEvent>(event: T, signer: HiddenContentSigner): Promise<string[][]>;
|
|
30
|
+
export declare function lockHiddenTags<T extends object>(event: T): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { canHaveHiddenContent, getHiddenContent, getHiddenContentEncryptionMethods, isHiddenContentLocked, unlockHiddenContent, } from "./hidden-content.js";
|
|
1
|
+
import { canHaveHiddenContent, getHiddenContent, getHiddenContentEncryptionMethods, isHiddenContentLocked, lockHiddenContent, unlockHiddenContent, } from "./hidden-content.js";
|
|
2
2
|
import { getOrComputeCachedValue } from "./cache.js";
|
|
3
3
|
export const HiddenTagsSymbol = Symbol.for("hidden-tags");
|
|
4
4
|
/** Checks if an event can have hidden tags */
|
|
@@ -45,3 +45,7 @@ export async function unlockHiddenTags(event, signer) {
|
|
|
45
45
|
await unlockHiddenContent(event, signer);
|
|
46
46
|
return getHiddenTags(event);
|
|
47
47
|
}
|
|
48
|
+
export function lockHiddenTags(event) {
|
|
49
|
+
Reflect.deleteProperty(event, HiddenTagsSymbol);
|
|
50
|
+
lockHiddenContent(event);
|
|
51
|
+
}
|