applesauce-core 0.0.0-next-20250221155809 → 0.0.0-next-20250221171454

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.
@@ -36,7 +36,11 @@ export declare function getListEncryptionMethods(kind: number, signer: HiddenTag
36
36
  * @param store An optional EventStore to notify about the update
37
37
  * @throws
38
38
  */
39
- export declare function unlockHiddenTags(event: NostrEvent, signer: HiddenTagsSigner, store?: EventStore): Promise<NostrEvent>;
39
+ export declare function unlockHiddenTags<T extends {
40
+ kind: number;
41
+ pubkey: string;
42
+ content: string;
43
+ }>(event: T, signer: HiddenTagsSigner, store?: EventStore): Promise<T>;
40
44
  /**
41
45
  * Override the hidden tags in an event
42
46
  * @throws
@@ -1,6 +1,7 @@
1
1
  import { kinds } from "nostr-tools";
2
2
  import { GROUPS_LIST_KIND } from "./groups.js";
3
3
  import { unixNow } from "./time.js";
4
+ import { isEvent } from "./event.js";
4
5
  export const HiddenTagsSymbol = Symbol.for("hidden-tags");
5
6
  /** Various event kinds that can have encrypted tags in their content and which encryption method they use */
6
7
  export const EventEncryptionMethod = {
@@ -63,7 +64,7 @@ export async function unlockHiddenTags(event, signer, store) {
63
64
  // Convert array to tags array string[][]
64
65
  const tags = parsed.filter((t) => Array.isArray(t)).map((t) => t.map((v) => String(v)));
65
66
  Reflect.set(event, HiddenTagsSymbol, tags);
66
- if (store)
67
+ if (store && isEvent(event))
67
68
  store.update(event);
68
69
  return event;
69
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-core",
3
- "version": "0.0.0-next-20250221155809",
3
+ "version": "0.0.0-next-20250221171454",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",