tauri-plugin-nostrnative 0.1.4 → 0.1.6

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.
Files changed (49) hide show
  1. package/LICENSE +21 -674
  2. package/README.md +5 -0
  3. package/dist-js/index.cjs +331 -71
  4. package/dist-js/index.d.ts +185 -5
  5. package/dist-js/index.js +299 -72
  6. package/package.json +1 -1
  7. package/permissions/autogenerated/allow-blossom-delete.toml +4 -0
  8. package/permissions/autogenerated/allow-blossom-list.toml +4 -0
  9. package/permissions/autogenerated/allow-blossom-upload.toml +4 -0
  10. package/permissions/autogenerated/commands/add_note_to_notebook.toml +13 -0
  11. package/permissions/autogenerated/commands/blossom_delete.toml +13 -0
  12. package/permissions/autogenerated/commands/blossom_list.toml +13 -0
  13. package/permissions/autogenerated/commands/compare_routstr_prices.toml +8 -0
  14. package/permissions/autogenerated/commands/create_note.toml +13 -0
  15. package/permissions/autogenerated/commands/create_notebook.toml +13 -0
  16. package/permissions/autogenerated/commands/delete_nfp_data.toml +9 -0
  17. package/permissions/autogenerated/commands/delete_note.toml +13 -0
  18. package/permissions/autogenerated/commands/delete_notebook.toml +13 -0
  19. package/permissions/autogenerated/commands/delete_virtual_fs.toml +12 -0
  20. package/permissions/autogenerated/commands/discover_routstr_providers.toml +8 -0
  21. package/permissions/autogenerated/commands/fetch_calendar_contact_lists.toml +13 -0
  22. package/permissions/autogenerated/commands/fetch_nfp_cycles.toml +9 -0
  23. package/permissions/autogenerated/commands/fetch_nfp_observations.toml +13 -0
  24. package/permissions/autogenerated/commands/fetch_nfp_settings.toml +9 -0
  25. package/permissions/autogenerated/commands/fetch_notebooks.toml +13 -0
  26. package/permissions/autogenerated/commands/fetch_notes.toml +13 -0
  27. package/permissions/autogenerated/commands/fetch_routstr_models.toml +8 -0
  28. package/permissions/autogenerated/commands/fetch_virtual_fs.toml +13 -0
  29. package/permissions/autogenerated/commands/get_nostr_event_counts.toml +4 -0
  30. package/permissions/autogenerated/commands/get_nostr_relay_events.toml +4 -0
  31. package/permissions/autogenerated/commands/get_nostr_relay_status.toml +4 -0
  32. package/permissions/autogenerated/commands/hex_to_npub.toml +13 -0
  33. package/permissions/autogenerated/commands/npub_to_hex.toml +13 -0
  34. package/permissions/autogenerated/commands/publish_calendar_contact_list.toml +13 -0
  35. package/permissions/autogenerated/commands/publish_nfp_cycle.toml +9 -0
  36. package/permissions/autogenerated/commands/publish_nfp_observation.toml +9 -0
  37. package/permissions/autogenerated/commands/publish_nfp_settings.toml +9 -0
  38. package/permissions/autogenerated/commands/publish_virtual_fs.toml +13 -0
  39. package/permissions/autogenerated/commands/remove_note_from_notebook.toml +13 -0
  40. package/permissions/autogenerated/commands/start_nostr_relay.toml +4 -0
  41. package/permissions/autogenerated/commands/stop_nostr_relay.toml +4 -0
  42. package/permissions/autogenerated/commands/update_nfp_cycle.toml +13 -0
  43. package/permissions/autogenerated/commands/update_nfp_observation.toml +13 -0
  44. package/permissions/autogenerated/commands/update_nfp_settings.toml +13 -0
  45. package/permissions/autogenerated/commands/update_note.toml +13 -0
  46. package/permissions/autogenerated/reference.md +1034 -131
  47. package/permissions/default.json +18 -0
  48. package/permissions/default.toml +35 -1
  49. package/permissions/schemas/schema.json +404 -2
@@ -22,12 +22,19 @@ export interface CalendarRequest {
22
22
  description?: string;
23
23
  identifier: string;
24
24
  }
25
+ export interface CalendarContactListRequest {
26
+ identifier: string;
27
+ contacts: string[];
28
+ is_private: boolean;
29
+ }
25
30
  export interface Contact {
26
31
  pubkey: string;
32
+ npub?: string;
27
33
  alias?: string | null;
28
34
  }
29
35
  export interface UserProfile {
30
36
  pubkey: string;
37
+ npub?: string;
31
38
  name?: string | null;
32
39
  display_name?: string | null;
33
40
  about?: string | null;
@@ -36,7 +43,17 @@ export interface UserProfile {
36
43
  website?: string | null;
37
44
  nip05?: string | null;
38
45
  }
39
- export type BookmarkSource = 'public' | 'private' | 'website';
46
+ export type BookmarkSource = "public" | "private" | "website";
47
+ export interface NoteRequest {
48
+ content: string;
49
+ note_type: string;
50
+ identifier?: string;
51
+ group_id?: string;
52
+ }
53
+ export interface NotebookRequest {
54
+ title: string;
55
+ description?: string;
56
+ }
40
57
  export interface EventResponse {
41
58
  id: string;
42
59
  pubkey: string;
@@ -63,6 +80,19 @@ export interface PnsDerivedKeys {
63
80
  public_key: string;
64
81
  secret_key: string;
65
82
  }
83
+ export interface RoutstrProvider {
84
+ pubkey: string;
85
+ name: string;
86
+ about: string;
87
+ urls: string[];
88
+ mints: string[];
89
+ version?: string | null;
90
+ is_official: boolean;
91
+ price_prompt?: number | null;
92
+ price_completion?: number | null;
93
+ }
94
+ export declare function hexToNpub(hex: string): Promise<string>;
95
+ export declare function npubToHex(npub: string): Promise<string>;
66
96
  export declare function generateNewNsec(): Promise<string>;
67
97
  export declare function parsePubkey(pubkey: string): Promise<string>;
68
98
  export declare function verifyNsec(nsec: string): Promise<string>;
@@ -72,17 +102,28 @@ export declare function fetchCalendarEvents(pubkey: string, relays: string[], op
72
102
  rangeEnd?: number;
73
103
  authors?: string[];
74
104
  clientNsec?: string;
105
+ filters?: unknown[];
75
106
  }): Promise<EventResponse[]>;
76
107
  export declare function publishBatchCalendarEvents(nsec: string, relays: string[], events: CalendarEventRequest[], clientNsec?: string): Promise<string[]>;
108
+ export declare function startNostrRelay(port: number, dbPath: string): Promise<void>;
109
+ export declare function stopNostrRelay(): Promise<void>;
110
+ export declare function getNostrRelayStatus(): Promise<boolean>;
111
+ export declare function getNostrEventCounts(): Promise<Record<number, number>>;
112
+ export declare function getNostrRelayEvents(): Promise<EventResponse[]>;
77
113
  export declare function publishCalendarEvent(nsec: string, relays: string[], eventData: CalendarEventRequest, clientNsec?: string): Promise<string>;
78
114
  export declare function deleteCalendarEvent(nsec: string, relays: string[], eventIds: string[], clientNsec?: string): Promise<string>;
79
115
  export declare function fetchCalendars(pubkey: string, relays: string[]): Promise<EventResponse[]>;
80
116
  export declare function publishCalendar(nsec: string, relays: string[], calendar: CalendarRequest, clientNsec?: string): Promise<string>;
81
117
  export declare function deleteCalendar(nsec: string, relays: string[], identifier: string, clientNsec?: string): Promise<string>;
118
+ export declare function fetchCalendarContactLists(pubkey: string, relays: string[], options?: {
119
+ nsec?: string;
120
+ clientNsec?: string;
121
+ }): Promise<EventResponse[]>;
122
+ export declare function publishCalendarContactList(nsec: string, relays: string[], request: CalendarContactListRequest, clientNsec?: string): Promise<string>;
82
123
  export declare function fetchRsvps(eventCoordinate: string, relays: string[]): Promise<EventResponse[]>;
83
124
  export declare function fetchUserRsvps(pubkey: string, relays: string[]): Promise<EventResponse[]>;
84
125
  export declare function fetchReceivedRsvps(pubkey: string, relays: string[]): Promise<EventResponse[]>;
85
- export declare function publishRsvp(nsec: string, relays: string[], eventCoordinate: string, status: string, eventAuthor?: string, clientNsec?: string): Promise<string>;
126
+ export declare function publishRsvp(nsec: string, relays: string[], eventCoordinate: string, status: string, eventAuthor?: string, clientNsec?: string, fb?: string, content?: string): Promise<string>;
86
127
  export declare function fetchProfiles(pubkeys: string[], relays: string[]): Promise<UserProfile[]>;
87
128
  export declare function fetchContactList(pubkey: string, relays: string[]): Promise<Contact[]>;
88
129
  export declare function updateContactList(nsec: string, relays: string[], contacts: Contact[], clientNsec?: string): Promise<string>;
@@ -91,10 +132,28 @@ export declare function fetchBookmarks(pubkey: string, relays: string[], nsec?:
91
132
  export declare function fetchEventDetails(identifiers: string[], relays: string[]): Promise<EventResponse[]>;
92
133
  export declare function saveBookmark(nsec: string, relays: string[], eventId: string, source: BookmarkSource, clientNsec?: string): Promise<string>;
93
134
  export declare function removeBookmark(nsec: string, relays: string[], eventId: string, source: BookmarkSource, clientNsec?: string): Promise<string>;
94
- export declare function blossomMirror(serverUrl: string, nsec: string, url: string, clientNsec?: string): Promise<string>;
95
- export declare function blossomUpload(serverUrl: string, nsec: string, filePath: string, clientNsec?: string): Promise<string>;
96
- export declare function blossomUploadContent(serverUrl: string, nsec: string, content: string, filename?: string, mediaType?: string, clientNsec?: string): Promise<string>;
135
+ export declare function createNote(nsec: string, relays: string[], note: NoteRequest, clientNsec?: string): Promise<string>;
136
+ export declare function updateNote(nsec: string, relays: string[], identifier: string, note: NoteRequest, clientNsec?: string): Promise<string>;
137
+ export declare function deleteNote(nsec: string, relays: string[], noteId: string, clientNsec?: string): Promise<string>;
138
+ export declare function fetchNotes(pubkey: string, relays: string[], options?: {
139
+ nsec?: string;
140
+ noteType?: string;
141
+ clientNsec?: string;
142
+ }): Promise<EventResponse[]>;
143
+ export declare function createNotebook(nsec: string, relays: string[], notebook: NotebookRequest, clientNsec?: string): Promise<string>;
144
+ export declare function fetchNotebooks(pubkey: string, relays: string[], options?: {
145
+ nsec?: string;
146
+ clientNsec?: string;
147
+ }): Promise<EventResponse[]>;
148
+ export declare function addNoteToNotebook(nsec: string, relays: string[], notebookId: string, noteId: string, clientNsec?: string): Promise<string>;
149
+ export declare function removeNoteFromNotebook(nsec: string, relays: string[], notebookId: string, noteId: string, clientNsec?: string): Promise<string>;
150
+ export declare function deleteNotebook(nsec: string, relays: string[], notebookId: string, clientNsec?: string): Promise<string>;
151
+ export declare function blossomMirror(serverUrl: string, authHeader: string, url: string): Promise<string>;
152
+ export declare function blossomUpload(serverUrl: string, authHeader: string, filePath: string): Promise<string>;
153
+ export declare function blossomUploadContent(serverUrl: string, authHeader: string, content: string, filename?: string, mediaType?: string): Promise<string>;
97
154
  export declare function blossomGetBlob(serverUrl: string, hash: string): Promise<number[]>;
155
+ export declare function blossomDelete(serverUrl: string, authHeader: string, hash: string): Promise<void>;
156
+ export declare function blossomList(serverUrl: string, pubkey: string, authHeader?: string): Promise<any[]>;
98
157
  export declare function derivePnsKeys(deviceKeyHex: string): Promise<PnsDerivedKeys>;
99
158
  export declare function createDiscoveryEvent(nsec: string, deviceKeyToStore: string, relays: string[], clientNsec?: string): Promise<string>;
100
159
  export declare function decryptDiscoveryEvent(nsec: string, content: string, clientNsec?: string): Promise<string>;
@@ -103,3 +162,124 @@ export declare function decryptPnsEvent(pnsNsec: string, content: string, client
103
162
  export declare function fetchPnsEvents(pnsPubkey: string, relays: string[], eventId?: string): Promise<EventResponse[]>;
104
163
  export declare function deleteChatMessages(pnsNsec: string, relays: string[], eventIds: string[], clientNsec?: string): Promise<string>;
105
164
  export declare function fetchDiscoveryEvents(pubkey: string, relays: string[]): Promise<EventResponse[]>;
165
+ export declare function discoverRoutstrProviders(relays: string[]): Promise<RoutstrProvider[]>;
166
+ export declare function compareRoutstrPrices(providerUrls: string[]): Promise<any>;
167
+ export interface NFPTemperature {
168
+ value: number;
169
+ time: string;
170
+ method: string;
171
+ disturbance?: string;
172
+ }
173
+ export interface NFPCervicalFluid {
174
+ sensation: string;
175
+ appearance?: string;
176
+ amount?: string;
177
+ }
178
+ export interface NFPCervixPosition {
179
+ height: string;
180
+ firmness: string;
181
+ opening: string;
182
+ }
183
+ export interface NFPBleeding {
184
+ flow: string;
185
+ color?: string;
186
+ }
187
+ export interface NFPObservationRequest {
188
+ date: string;
189
+ identifier: string;
190
+ temperature?: NFPTemperature;
191
+ cervical_fluid?: NFPCervicalFluid;
192
+ cervix_position?: NFPCervixPosition;
193
+ bleeding?: NFPBleeding;
194
+ notes?: string;
195
+ disturbances?: string[];
196
+ }
197
+ export interface NFPCycleRequest {
198
+ identifier: string;
199
+ start_date: string;
200
+ end_date?: string;
201
+ length?: number;
202
+ fertility_window_start?: string;
203
+ fertility_window_end?: string;
204
+ peak_day?: string;
205
+ ovulation_day?: string;
206
+ luteal_phase_length?: number;
207
+ }
208
+ export interface NFPSettingsRequest {
209
+ identifier: string;
210
+ temperature_unit: string;
211
+ temperature_method: string;
212
+ reminder_time?: string;
213
+ average_cycle_length: number;
214
+ luteal_phase_length?: number;
215
+ require_pin_on_open: boolean;
216
+ auto_lock_after_minutes?: number;
217
+ sync_enabled: boolean;
218
+ encrypted_backup: boolean;
219
+ theme: string;
220
+ chart_style: string;
221
+ show_predictions: boolean;
222
+ temperature_reminder: boolean;
223
+ ovulation_prediction: boolean;
224
+ cycle_end_prediction: boolean;
225
+ }
226
+ export interface FilesystemMetadata {
227
+ name: string;
228
+ version: string;
229
+ max_depth: number;
230
+ total_nodes: number;
231
+ total_size: number;
232
+ created_at: number;
233
+ }
234
+ export interface FileNodeMetadata {
235
+ created: number;
236
+ modified: number;
237
+ permissions: string;
238
+ size: number;
239
+ mime_type: string;
240
+ content_hash: string;
241
+ }
242
+ export interface DirectoryNodeMetadata {
243
+ created: number;
244
+ modified: number;
245
+ permissions: string;
246
+ }
247
+ export interface ContentReference {
248
+ source: string;
249
+ kind?: number;
250
+ id: string;
251
+ url?: string;
252
+ }
253
+ export type VirtualNode = {
254
+ type: "file";
255
+ name: string;
256
+ depth: number;
257
+ metadata: FileNodeMetadata;
258
+ content_ref?: ContentReference;
259
+ } | {
260
+ type: "directory";
261
+ name: string;
262
+ depth: number;
263
+ metadata: DirectoryNodeMetadata;
264
+ children: VirtualNode[];
265
+ };
266
+ export interface VirtualFilesystem {
267
+ root: VirtualNode;
268
+ metadata: FilesystemMetadata;
269
+ }
270
+ export interface FilesystemRequest {
271
+ identifier: string;
272
+ name: string;
273
+ filesystem: VirtualFilesystem;
274
+ }
275
+ export declare function fetchNfpObservations(pubkey: string, nsec: string | null, relays: string[], rangeStart: number | null, rangeEnd: number | null, clientNsec: string | null): Promise<EventResponse[]>;
276
+ export declare function publishNfpObservation(nsec: string, relays: string[], observation: NFPObservationRequest, clientNsec: string | null): Promise<string>;
277
+ export declare function fetchNfpCycles(pubkey: string, nsec: string | null, relays: string[], clientNsec: string | null): Promise<EventResponse[]>;
278
+ export declare function publishNfpCycle(nsec: string, relays: string[], cycle: NFPCycleRequest, clientNsec: string | null): Promise<string>;
279
+ export declare function fetchNfpSettings(pubkey: string, nsec: string | null, relays: string[], clientNsec: string | null): Promise<EventResponse | null>;
280
+ export declare function publishNfpSettings(nsec: string, relays: string[], settings: NFPSettingsRequest, clientNsec: string | null): Promise<string>;
281
+ export declare function deleteNfpData(nsec: string, relays: string[], eventIds: string[], clientNsec: string | null): Promise<string>;
282
+ export declare function publishVirtualFs(nsec: string, relays: string[], req: FilesystemRequest, clientNsec?: string): Promise<string>;
283
+ export declare function fetchVirtualFs(pubkey: string, relays: string[]): Promise<EventResponse[]>;
284
+ export declare function deleteVirtualFs(nsec: string, relays: string[], identifier: string, clientNsec?: string): Promise<string>;
285
+ export declare function fetchRoutstrModels(providerUrl: string): Promise<any[]>;