MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / openNoteWithDeepLink

Function openNoteWithDeepLink

integrations/raycast/src/lib/zen.ts:140–169  ·  view source on GitHub ↗
(
  note: Pick<ZenNote, "path" | "title">,
  action: "open" | "open-window",
  messages: {
    openingTitle: string;
    successTitle: string;
    failureTitle: string;
  },
)

Source from the content-addressed store, hash-verified

138}
139
140async function openNoteWithDeepLink(
141 note: Pick<ZenNote, "path" | "title">,
142 action: "open" | "open-window",
143 messages: {
144 openingTitle: string;
145 successTitle: string;
146 failureTitle: string;
147 },
148): Promise<void> {
149 await showToast({
150 style: Toast.Style.Animated,
151 title: messages.openingTitle,
152 message: note.title,
153 });
154
155 try {
156 await open(`zennotes://${action}?path=${encodeURIComponent(note.path)}`);
157 await showToast({
158 style: Toast.Style.Success,
159 title: messages.successTitle,
160 message: note.title,
161 });
162 } catch (err) {
163 await showToast({
164 style: Toast.Style.Failure,
165 title: messages.failureTitle,
166 message: err instanceof Error ? err.message : String(err),
167 });
168 }
169}
170
171export function absoluteNotePath(
172 vaultRoot: string | null,

Callers 2

openNoteInZenNotesFunction · 0.85
openNoteInFloatingWindowFunction · 0.85

Calls 1

openFunction · 0.50

Tested by

no test coverage detected