├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── LICENSE.txt ├── README.md ├── handle_error.scpt ├── icon.png ├── info.plist ├── search_notes ├── Makefile ├── alfred │ └── alfred.go ├── go.mod ├── go.sum ├── main.go └── proto │ ├── README.md │ ├── notestore.pb.go │ └── notestore.proto └── update.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: 4 | patreon: sballin 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | thanks_dev: # Replace with a single thanks.dev username 15 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Most common problem** 11 | 12 | unable to open database: have you tried turning full disk access for Alfred off and on again in System Settings? 13 | 14 | **To Reproduce** 15 | 16 | Steps/context to reproduce the behavior: 17 | 18 | 1. Search for a note 19 | 2. ... 20 | 21 | **Error text** 22 | 23 | Copy and paste the full error text from any error messages. Screenshots can also help but may not show the full text. 24 | 25 | **Info** 26 | 27 | Fill out this information if it's not already included in the error text. 28 | 29 | - macOS version: 30 | - CPU: Intel or Apple (M1)? 31 | - Alfred version: 32 | - Workflow version: 33 | - In System Preferences > Security & Privacy > Privacy, there are checkmarks for Accessibility > Alfred 4, Full Disk Access > Alfred 4, Automation > Alfred 4 > Notes, and Automation > Alfred 4 > System Events? 34 | - What type of account are your notes stored in (iCloud/On My Mac/Email)? 35 | - If the workflow can't manage to show a list of your notes, verify that the search_notes executable file is present by right-clicking the "Search Notes" workflow in the workflow list of Alfred Preferences, choosing "Open in Finder" and opening the search_notes folder. Is there a file of the same name inside that folder? 36 | - If no error notification appears automatically, what is the output of the [debug log](https://www.alfredapp.com/help/workflows/advanced/debugger/) when you reproduce the problem? 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | xcuserdata/ 3 | error_log.txt 4 | __pycache__/ 5 | *.app 6 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sean Ballinger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Search Notes.app with Alfred 2 | 3 | This is an Alfred workflow to find and open Apple/iCloud notes in Notes.app! It's written in Go and designed to be ripping fast, even for very large Notes databases, can search everything including note and attachment contents, and supports accented characters and non-Latin scripts. 4 | 5 | * Download the latest version: [[github]](https://github.com/sballin/alfred-search-notes-app/releases/latest/download/Search.Notes.alfredworkflow) 6 | * Instructions to fix permissions issues: [[github]](https://github.com/sballin/alfred-search-notes-app?tab=readme-ov-file#troubleshooting) 7 | * View additional issues and get help: [[github]](https://github.com/sballin/alfred-search-notes-app/issues?q=is%3Aissue) 8 | * Support me maintaining this thing and keeping the binary verified: [[patreon]](https://www.patreon.com/sballin) 9 | 10 | Privacy note: this workflow uses a Go binary to search your Notes database. The binary is [open source](https://github.com/sballin/alfred-search-notes-app/blob/master/search_notes/main.go) with [instructions](https://github.com/sballin/alfred-search-notes-app/tree/master?tab=readme-ov-file#compile) on how to compile it yourself. For extra peace of mind, consider supporting me on [Patreon](https://www.patreon.com/sballin) so that the binary can be regularly verified for malicious content by Apple ($99/year Apple Developer Program membership required). 11 | 12 | ### Search titles or create a new note if none was found 13 | 14 | 15 | 16 | 17 | 18 | ### Search note titles and bodies 19 | 20 | 21 | 22 | ### Search folder names 23 | 24 | 25 | 26 | ### Result actions 27 | 28 | * **enter** to open the note/folder or create a new note if none was found 29 | * **shift+enter** to search for your Alfred query using the Notes in-app search 30 | * **cmd+enter** to copy the note body to the clipboard 31 | * **alt+enter** to copy a link to the note to the clipboard 32 | 33 | ### Note linking 34 | 35 | You can generate links to any of your notes and use them on macOS or iOS. Copy the note URL by pressing alt+enter on an Alfred result or paste it using the snippet. This will generate two links. The first one works on macOS Big Sur (11) and newer, and the second one works on iOS. 36 | 37 | ## Install 38 | 39 | Download the [latest version](https://github.com/sballin/alfred-search-notes-app/releases/latest/download/Search.Notes.alfredworkflow) of the workflow if you're on the latest macOS with Alfred >= 4. For older versions of macOS, you may need to use [older versions](https://github.com/sballin/alfred-search-notes-app/releases) of the workflow. 40 | 41 | ### Required setup 42 | 43 | 1. Try searching for a note 44 | 2. If a warning dialog appears (see image below), click "Cancel" rather than "Move to Trash". Then open System Preferences > Security & Privacy and click the "Open Anyway" button near the bottom 45 | 4. Approve additional requests for permission as they appear 46 | 5. If there are any other issues, please follow the advice under [troubleshooting](#troubleshooting), if present, is enabled 47 | 48 | 49 | 50 | ### Troubleshooting 51 | 52 | If the script produces an error, especially after installing updates to macOS, try turning the permissions below off and on again. Please look through [common issues](https://github.com/sballin/alfred-search-notes-app/issues?q=) before submitting a new one. 53 | 54 | __The most common issue `panic: unable to open database file: operation not permitted` is fixed by turning full disk access for Alfred off and on again.__ 55 | 56 | 57 | 58 | ### Email notes are not supported 59 | 60 | This workflow doesn't support notes stored with Google or other internet accounts. Please make sure either iCloud or On My Mac is selected as the default account in the preferences of Notes.app. 61 | 62 | ## Customize search behavior 63 | 64 | Result ordering and title+folder search behavior can be controlled using the [environment variables](https://www.alfredapp.com/help/workflows/advanced/variables/#environment). 65 | 66 | ## Updates 67 | 68 | By default, the workflow checks Github for updates if you run it and it's been 4 days since the last check. This can be disabled by removing the connections to the OneUpdater block in the workflow. 69 | 70 | ## Compile 71 | 72 | If you want to compile the binary yourself, you can go into the "search_notes" folder and do `make`. 73 | 74 | ## Contributors 75 | 76 | Big thanks to... 77 | 78 | * All who have submitted pull requests 79 | * drgrib for allowing me to build off the [alfred-bear](https://github.com/drgrib/alfred-bear) workflow 80 | * threeplanetssoftware for the [apple_cloud_notes_parser](https://github.com/threeplanetssoftware/apple_cloud_notes_parser) from which I copied the protobuf handling 81 | * [lslz627](https://github.com/lslz627) for help with protobuf and tables 82 | * [Artem Chistyakov](https://temochka.com/blog/posts/2020/02/22/linking-to-apple-notes.html) for a much improved way to create links to notes 83 | * [vitorgalvao](https://github.com/vitorgalvao) for the OneUpdater code 84 | 85 | ## Donate 86 | 87 | If you enjoy using this workflow, consider [donating](http://paypal.me/sbballin)! 88 | -------------------------------------------------------------------------------- /handle_error.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sballin/alfred-search-notes-app/959049bf0525c8bf62cd4eb02cc189ccf66c88e4/handle_error.scpt -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- 1 | /System/Applications/Notes.app/Contents/Resources/AppIcon.icns -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | in.sball.searchnotes 7 | category 8 | Tools 9 | connections 10 | 11 | 060809AF-8160-439A-85F9-D672664E3A1A 12 | 13 | 14 | destinationuid 15 | 5BC84589-FA2A-459F-982A-54B612C9BA7F 16 | modifiers 17 | 0 18 | modifiersubtext 19 | 20 | vitoclose 21 | 22 | 23 | 24 | 092EA403-A1D7-49DA-B8DD-8D785DDAB3B9 25 | 26 | 27 | destinationuid 28 | A818751F-4F20-4FD1-87A9-C16C41723B16 29 | modifiers 30 | 0 31 | modifiersubtext 32 | 33 | vitoclose 34 | 35 | 36 | 37 | 19CCE92E-2C07-4CB4-9874-E29AA3563F37 38 | 39 | 40 | destinationuid 41 | A818751F-4F20-4FD1-87A9-C16C41723B16 42 | modifiers 43 | 0 44 | modifiersubtext 45 | 46 | vitoclose 47 | 48 | 49 | 50 | 1A6D4810-ABAF-4604-9639-CC1327A279B7 51 | 52 | 53 | destinationuid 54 | 5BC84589-FA2A-459F-982A-54B612C9BA7F 55 | modifiers 56 | 0 57 | modifiersubtext 58 | 59 | vitoclose 60 | 61 | 62 | 63 | 2A3C974B-57DF-4601-8EFC-4158CAA2005A 64 | 65 | 66 | destinationuid 67 | A057AD2C-473A-4823-8624-8891E5C187F6 68 | modifiers 69 | 0 70 | modifiersubtext 71 | 72 | vitoclose 73 | 74 | 75 | 76 | 4D8E3444-14C2-4D0E-A8C1-AA67988AE358 77 | 78 | 79 | destinationuid 80 | A818751F-4F20-4FD1-87A9-C16C41723B16 81 | modifiers 82 | 0 83 | modifiersubtext 84 | 85 | vitoclose 86 | 87 | 88 | 89 | 5BC84589-FA2A-459F-982A-54B612C9BA7F 90 | 91 | 92 | destinationuid 93 | CE746687-24FD-4E5C-841F-0D4826E007C4 94 | modifiers 95 | 131072 96 | modifiersubtext 97 | Search in Notes toolbar 98 | vitoclose 99 | 100 | 101 | 102 | destinationuid 103 | 6740BCB6-6818-49E2-A88A-9D19EA132F08 104 | modifiers 105 | 524288 106 | modifiersubtext 107 | Copy link to note 108 | vitoclose 109 | 110 | 111 | 112 | destinationuid 113 | DC692798-E272-4547-BE83-4B63B823E456 114 | modifiers 115 | 1048576 116 | modifiersubtext 117 | Copy note body 118 | vitoclose 119 | 120 | 121 | 122 | destinationuid 123 | 4D8E3444-14C2-4D0E-A8C1-AA67988AE358 124 | modifiers 125 | 0 126 | modifiersubtext 127 | 128 | vitoclose 129 | 130 | 131 | 132 | 6740BCB6-6818-49E2-A88A-9D19EA132F08 133 | 134 | 135 | destinationuid 136 | A818751F-4F20-4FD1-87A9-C16C41723B16 137 | modifiers 138 | 0 139 | modifiersubtext 140 | 141 | vitoclose 142 | 143 | 144 | 145 | 69AB99D4-3231-4959-828B-383C93051FCC 146 | 147 | 148 | destinationuid 149 | 092EA403-A1D7-49DA-B8DD-8D785DDAB3B9 150 | modifiers 151 | 0 152 | modifiersubtext 153 | 154 | vitoclose 155 | 156 | 157 | 158 | 6F3DD843-22EF-4A97-BAF8-511894B5202D 159 | 160 | 161 | destinationuid 162 | CE746687-24FD-4E5C-841F-0D4826E007C4 163 | modifiers 164 | 131072 165 | modifiersubtext 166 | Search in Notes toolbar 167 | vitoclose 168 | 169 | 170 | 171 | destinationuid 172 | 4D8E3444-14C2-4D0E-A8C1-AA67988AE358 173 | modifiers 174 | 0 175 | modifiersubtext 176 | 177 | vitoclose 178 | 179 | 180 | 181 | destinationuid 182 | 19CCE92E-2C07-4CB4-9874-E29AA3563F37 183 | modifiers 184 | 524288 185 | modifiersubtext 186 | Move currently selected note to this folder 187 | vitoclose 188 | 189 | 190 | 191 | A057AD2C-473A-4823-8624-8891E5C187F6 192 | 193 | 194 | destinationuid 195 | E91B4B80-CB26-4BC2-B808-5EC8A43F3E25 196 | modifiers 197 | 0 198 | modifiersubtext 199 | 200 | vitoclose 201 | 202 | 203 | 204 | B9ECD7D6-EA33-4E2E-AE3E-4E22EEDD6097 205 | 206 | 207 | destinationuid 208 | CE746687-24FD-4E5C-841F-0D4826E007C4 209 | modifiers 210 | 131072 211 | modifiersubtext 212 | Search in Notes toolbar 213 | vitoclose 214 | 215 | 216 | 217 | destinationuid 218 | 6740BCB6-6818-49E2-A88A-9D19EA132F08 219 | modifiers 220 | 524288 221 | modifiersubtext 222 | Copy link to note 223 | vitoclose 224 | 225 | 226 | 227 | destinationuid 228 | DC692798-E272-4547-BE83-4B63B823E456 229 | modifiers 230 | 1048576 231 | modifiersubtext 232 | Copy note body 233 | vitoclose 234 | 235 | 236 | 237 | destinationuid 238 | 4D8E3444-14C2-4D0E-A8C1-AA67988AE358 239 | modifiers 240 | 0 241 | modifiersubtext 242 | 243 | vitoclose 244 | 245 | 246 | 247 | CAA4E408-453B-4518-B2B1-CD024BAA493C 248 | 249 | 250 | destinationuid 251 | CE746687-24FD-4E5C-841F-0D4826E007C4 252 | modifiers 253 | 131072 254 | modifiersubtext 255 | Search in Notes toolbar 256 | vitoclose 257 | 258 | 259 | 260 | destinationuid 261 | 6740BCB6-6818-49E2-A88A-9D19EA132F08 262 | modifiers 263 | 524288 264 | modifiersubtext 265 | Copy link to note 266 | vitoclose 267 | 268 | 269 | 270 | destinationuid 271 | DC692798-E272-4547-BE83-4B63B823E456 272 | modifiers 273 | 1048576 274 | modifiersubtext 275 | Copy note body 276 | vitoclose 277 | 278 | 279 | 280 | destinationuid 281 | 4D8E3444-14C2-4D0E-A8C1-AA67988AE358 282 | modifiers 283 | 0 284 | modifiersubtext 285 | 286 | vitoclose 287 | 288 | 289 | 290 | CE746687-24FD-4E5C-841F-0D4826E007C4 291 | 292 | 293 | destinationuid 294 | A818751F-4F20-4FD1-87A9-C16C41723B16 295 | modifiers 296 | 0 297 | modifiersubtext 298 | 299 | vitoclose 300 | 301 | 302 | 303 | DC692798-E272-4547-BE83-4B63B823E456 304 | 305 | 306 | destinationuid 307 | A818751F-4F20-4FD1-87A9-C16C41723B16 308 | modifiers 309 | 0 310 | modifiersubtext 311 | 312 | vitoclose 313 | 314 | 315 | 316 | E91B4B80-CB26-4BC2-B808-5EC8A43F3E25 317 | 318 | 319 | destinationuid 320 | A818751F-4F20-4FD1-87A9-C16C41723B16 321 | modifiers 322 | 0 323 | modifiersubtext 324 | 325 | vitoclose 326 | 327 | 328 | 329 | 330 | createdby 331 | Sean Ballinger 332 | description 333 | Open notes in iCloud/Apple Notes 334 | disabled 335 | 336 | name 337 | Search Notes 338 | objects 339 | 340 | 341 | config 342 | 343 | action 344 | 0 345 | argument 346 | 0 347 | focusedappvariable 348 | 349 | focusedappvariablename 350 | 351 | hotkey 352 | 49 353 | hotmod 354 | 1572864 355 | hotstring 356 | Space 357 | leftcursor 358 | 359 | modsmode 360 | 2 361 | relatedAppsMode 362 | 0 363 | 364 | type 365 | alfred.workflow.trigger.hotkey 366 | uid 367 | 1A6D4810-ABAF-4604-9639-CC1327A279B7 368 | version 369 | 2 370 | 371 | 372 | config 373 | 374 | applescript 375 | -- This script takes "URLs" of format "identifier,itemID,accountID,itemFolderID,userQuery" or just "userQuery" 376 | 377 | on alfred_script(q) 378 | try 379 | tell application "System Events" 380 | tell process "Notes" 381 | -- Get search string 382 | if q contains "/ICNote/p" or q contains "/ICFolder/p" then 383 | set AppleScript's text item delimiters to "," 384 | set userQuery to text from text item 5 to text item -1 of q 385 | set AppleScript's text item delimiters to "" 386 | else 387 | set userQuery to q 388 | end if 389 | -- Enter the string in the Notes search bar 390 | set frontmost to true 391 | click menu item 1 of menu of menu item 17 of menu 4 of menu bar 1 -- Edit, Find, Note List Search… 392 | set clipboardOld to the clipboard 393 | set the clipboard to userQuery 394 | click menu item 6 of menu 4 of menu bar 1 -- Edit, Paste 395 | delay 0.1 396 | set the clipboard to clipboardOld 397 | end tell 398 | end tell 399 | on error errorMessage number errorNumber 400 | display alert "Search in Notes Toolbar Error" message (errorNumber as string & ": " & errorMessage & "\n\nInput: " & q) as critical 401 | end try 402 | end alfred_script 403 | cachescript 404 | 405 | 406 | type 407 | alfred.workflow.action.applescript 408 | uid 409 | CE746687-24FD-4E5C-841F-0D4826E007C4 410 | version 411 | 1 412 | 413 | 414 | config 415 | 416 | alfredfiltersresults 417 | 418 | alfredfiltersresultsmatchmode 419 | 0 420 | argumenttreatemptyqueryasnil 421 | 422 | argumenttrimmode 423 | 0 424 | argumenttype 425 | 1 426 | escaping 427 | 68 428 | keyword 429 | n 430 | queuedelaycustom 431 | 3 432 | queuedelayimmediatelyinitially 433 | 434 | queuedelaymode 435 | 0 436 | queuemode 437 | 2 438 | runningsubtext 439 | Getting notes... 440 | script 441 | scope="title" 442 | workflow_dir="$alfred_preferences/workflows/$alfred_workflow_uid" 443 | search_notes="$workflow_dir/search_notes/search_notes" 444 | if [[ ! -f "$workflow_dir/authorized" ]]; then 445 | xattr -rd com.apple.quarantine "$workflow_dir" 446 | touch "$workflow_dir/authorized" 447 | fi 448 | out=`"$search_notes" $scope "$@" 2>&1` 449 | if [[ $? != 0 ]]; then 450 | nl=$'\n' 451 | notes_db="$HOME/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite" 452 | macos="macOS: $(sw_vers -productVersion)${nl}" 453 | alf_version="Alfred: ${alfred_version}${nl}" 454 | workflow_version="Workflow: ${alfred_workflow_version}${nl}" 455 | cpu_arch="CPU: $(machine)${nl}" 456 | bin_xattrs="Binary xattrs: $(xattr "$search_notes")${nl}" 457 | db_xattrs="Notes DB xattrs: $(xattr "$notes_db")${nl}" 458 | bin_info="Binary info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$search_notes")${nl}" 459 | db_info="Notes DB info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$notes_db")${nl}" 460 | alfred_query="Query: $scope '$@'${nl}" 461 | osascript "$workflow_dir/handle_error.scpt" "Please copy this entire text if submitting an error report. You may need to scroll.${nl}${nl}${out}${nl}${nl}${macos}${alf_version}${workflow_version}${cpu_arch}${bin_xattrs}${db_xattrs}${bin_info}${db_info}${alfred_query}" 462 | else 463 | echo $out 464 | fi 465 | scriptargtype 466 | 1 467 | scriptfile 468 | cmd/search_titles/search_titles 469 | subtext 470 | 471 | title 472 | Search notes 473 | type 474 | 0 475 | withspace 476 | 477 | 478 | type 479 | alfred.workflow.input.scriptfilter 480 | uid 481 | 5BC84589-FA2A-459F-982A-54B612C9BA7F 482 | version 483 | 3 484 | 485 | 486 | config 487 | 488 | action 489 | 0 490 | argument 491 | 0 492 | focusedappvariable 493 | 494 | focusedappvariablename 495 | 496 | hotkey 497 | 37 498 | hotmod 499 | 1048576 500 | hotstring 501 | L 502 | leftcursor 503 | 504 | modsmode 505 | 2 506 | relatedApps 507 | 508 | com.apple.Notes 509 | 510 | relatedAppsMode 511 | 1 512 | 513 | type 514 | alfred.workflow.trigger.hotkey 515 | uid 516 | 060809AF-8160-439A-85F9-D672664E3A1A 517 | version 518 | 2 519 | 520 | 521 | config 522 | 523 | alfredfiltersresults 524 | 525 | alfredfiltersresultsmatchmode 526 | 0 527 | argumenttreatemptyqueryasnil 528 | 529 | argumenttrimmode 530 | 0 531 | argumenttype 532 | 1 533 | escaping 534 | 68 535 | keyword 536 | nb 537 | queuedelaycustom 538 | 3 539 | queuedelayimmediatelyinitially 540 | 541 | queuedelaymode 542 | 0 543 | queuemode 544 | 2 545 | runningsubtext 546 | Getting notes... 547 | script 548 | scope="body" 549 | workflow_dir="$alfred_preferences/workflows/$alfred_workflow_uid" 550 | search_notes="$workflow_dir/search_notes/search_notes" 551 | if [[ ! -f "$workflow_dir/authorized" ]]; then 552 | xattr -rd com.apple.quarantine "$workflow_dir" 553 | touch "$workflow_dir/authorized" 554 | fi 555 | out=`"$search_notes" $scope "$@" 2>&1` 556 | if [[ $? != 0 ]]; then 557 | nl=$'\n' 558 | notes_db="$HOME/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite" 559 | macos="macOS: $(sw_vers -productVersion)${nl}" 560 | alf_version="Alfred: ${alfred_version}${nl}" 561 | workflow_version="Workflow: ${alfred_workflow_version}${nl}" 562 | cpu_arch="CPU: $(machine)${nl}" 563 | bin_xattrs="Binary xattrs: $(xattr "$search_notes")${nl}" 564 | db_xattrs="Notes DB xattrs: $(xattr "$notes_db")${nl}" 565 | bin_info="Binary info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$search_notes")${nl}" 566 | db_info="Notes DB info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$notes_db")${nl}" 567 | alfred_query="Query: $scope '$@'${nl}" 568 | osascript "$workflow_dir/handle_error.scpt" "Please copy this entire text if submitting an error report. You may need to scroll.${nl}${nl}${out}${nl}${nl}${macos}${alf_version}${workflow_version}${cpu_arch}${bin_xattrs}${db_xattrs}${bin_info}${db_info}${alfred_query}" 569 | else 570 | echo $out 571 | fi 572 | scriptargtype 573 | 1 574 | scriptfile 575 | get_note_bodies.py 576 | subtext 577 | 578 | title 579 | Search note bodies 580 | type 581 | 0 582 | withspace 583 | 584 | 585 | type 586 | alfred.workflow.input.scriptfilter 587 | uid 588 | B9ECD7D6-EA33-4E2E-AE3E-4E22EEDD6097 589 | version 590 | 3 591 | 592 | 593 | config 594 | 595 | applescript 596 | -- This script takes "URLs" of format "identifier,itemID,accountID,itemFolderID,userQuery" 597 | 598 | on alfred_script(q) 599 | try 600 | set AppleScript's text item delimiters to "," 601 | set identifier to text item 1 of q 602 | set AppleScript's text item delimiters to "" 603 | set the clipboard to "applenotes://note/" & identifier 604 | on error errorMessage number errorNumber 605 | display alert "Copy Link to Note Error" message (errorNumber as string & ": " & errorMessage & "\n\nInput: " & q) as critical 606 | end try 607 | end alfred_script 608 | cachescript 609 | 610 | 611 | type 612 | alfred.workflow.action.applescript 613 | uid 614 | 6740BCB6-6818-49E2-A88A-9D19EA132F08 615 | version 616 | 1 617 | 618 | 619 | config 620 | 621 | alfredfiltersresults 622 | 623 | alfredfiltersresultsmatchmode 624 | 0 625 | argumenttreatemptyqueryasnil 626 | 627 | argumenttrimmode 628 | 0 629 | argumenttype 630 | 1 631 | escaping 632 | 68 633 | keyword 634 | nf 635 | queuedelaycustom 636 | 3 637 | queuedelayimmediatelyinitially 638 | 639 | queuedelaymode 640 | 0 641 | queuemode 642 | 2 643 | runningsubtext 644 | Getting folders... 645 | script 646 | scope="folder" 647 | workflow_dir="$alfred_preferences/workflows/$alfred_workflow_uid" 648 | search_notes="$workflow_dir/search_notes/search_notes" 649 | if [[ ! -f "$workflow_dir/authorized" ]]; then 650 | xattr -rd com.apple.quarantine "$workflow_dir" 651 | touch "$workflow_dir/authorized" 652 | fi 653 | out=`"$search_notes" $scope "$@" 2>&1` 654 | if [[ $? != 0 ]]; then 655 | nl=$'\n' 656 | notes_db="$HOME/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite" 657 | macos="macOS: $(sw_vers -productVersion)${nl}" 658 | alf_version="Alfred: ${alfred_version}${nl}" 659 | workflow_version="Workflow: ${alfred_workflow_version}${nl}" 660 | cpu_arch="CPU: $(machine)${nl}" 661 | bin_xattrs="Binary xattrs: $(xattr "$search_notes")${nl}" 662 | db_xattrs="Notes DB xattrs: $(xattr "$notes_db")${nl}" 663 | bin_info="Binary info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$search_notes")${nl}" 664 | db_info="Notes DB info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$notes_db")${nl}" 665 | alfred_query="Query: $scope '$@'${nl}" 666 | osascript "$workflow_dir/handle_error.scpt" "Please copy this entire text if submitting an error report. You may need to scroll.${nl}${nl}${out}${nl}${nl}${macos}${alf_version}${workflow_version}${cpu_arch}${bin_xattrs}${db_xattrs}${bin_info}${db_info}${alfred_query}" 667 | else 668 | echo $out 669 | fi 670 | scriptargtype 671 | 1 672 | scriptfile 673 | get_folders.py 674 | subtext 675 | 676 | title 677 | Search note folders 678 | type 679 | 0 680 | withspace 681 | 682 | 683 | type 684 | alfred.workflow.input.scriptfilter 685 | uid 686 | 6F3DD843-22EF-4A97-BAF8-511894B5202D 687 | version 688 | 3 689 | 690 | 691 | config 692 | 693 | applescript 694 | -- This script takes "URLs" of format "identifier,itemID,accountID,itemFolderID,userQuery" 695 | -- accountID can be the string "null", if so the default account is used 696 | 697 | on alfred_script(q) 698 | try 699 | set AppleScript's text item delimiters to "," 700 | set identifier to text item 1 of q 701 | set itemID to text item 2 of q 702 | set accountID to text item 3 of q 703 | set AppleScript's text item delimiters to "" 704 | if accountID is "null" then 705 | tell application "Notes" to get plaintext of note id itemID in default account 706 | else 707 | tell application "Notes" to get plaintext of note id itemID in account id accountID 708 | end if 709 | set body to text (paragraph 2) thru -1 of the result 710 | set the clipboard to body 711 | on error errorMessage number errorNumber 712 | display alert "Copy Note Body Error" message (errorNumber as string & ": " & errorMessage & "\n\nInput: " & q) as critical 713 | end try 714 | end alfred_script 715 | cachescript 716 | 717 | 718 | type 719 | alfred.workflow.action.applescript 720 | uid 721 | DC692798-E272-4547-BE83-4B63B823E456 722 | version 723 | 1 724 | 725 | 726 | config 727 | 728 | concurrently 729 | 730 | escaping 731 | 0 732 | script 733 | # THESE VARIABLES MUST BE SET. SEE THE ONEUPDATER README FOR AN EXPLANATION OF EACH. 734 | readonly remote_info_plist='https://raw.githubusercontent.com/sballin/alfred-search-notes-app/master/info.plist' 735 | readonly workflow_url='sballin/alfred-search-notes-app' 736 | readonly download_type='github_release' 737 | readonly frequency_check='4' 738 | 739 | # FROM HERE ON, CODE SHOULD BE LEFT UNTOUCHED! 740 | function abort { 741 | echo "${1}" >&2 742 | exit 1 743 | } 744 | 745 | function url_exists { 746 | curl --silent --location --output /dev/null --fail --range 0-0 "${1}" 747 | } 748 | 749 | function notification { 750 | local -r notificator="$(find . -type f -name 'notificator')" 751 | 752 | if [[ -f "${notificator}" && "$(/usr/bin/file --brief --mime-type "${notificator}")" == 'text/x-shellscript' ]]; then 753 | "${notificator}" --message "${1}" --title "${alfred_workflow_name}" --subtitle 'A new version is available' 754 | return 755 | fi 756 | 757 | osascript -e "display notification \"${1}\" with title \"${alfred_workflow_name}\" subtitle \"A new version is available\"" 758 | } 759 | 760 | # Local sanity checks 761 | readonly local_info_plist='info.plist' 762 | readonly local_version="$(/usr/libexec/PlistBuddy -c 'print version' "${local_info_plist}")" 763 | 764 | [[ -n "${local_version}" ]] || abort 'You need to set a workflow version in the configuration sheet.' 765 | [[ "${download_type}" =~ ^(direct|page|github_release)$ ]] || abort "'download_type' (${download_type}) needs to be one of 'direct', 'page', or 'github_release'." 766 | [[ "${frequency_check}" =~ ^[0-9]+$ ]] || abort "'frequency_check' (${frequency_check}) needs to be a number." 767 | 768 | # Check for updates 769 | if [[ $(find "${local_info_plist}" -mtime +"${frequency_check}"d) ]]; then 770 | # Remote sanity check 771 | if ! url_exists "${remote_info_plist}"; then 772 | abort "'remote_info_plist' (${remote_info_plist}) appears to not be reachable." 773 | fi 774 | 775 | readonly tmp_file="$(mktemp)" 776 | curl --silent --location --output "${tmp_file}" "${remote_info_plist}" 777 | readonly remote_version="$(/usr/libexec/PlistBuddy -c 'print version' "${tmp_file}")" 778 | rm "${tmp_file}" 779 | 780 | if [[ "${local_version}" == "${remote_version}" ]]; then 781 | touch "${local_info_plist}" # Reset timer by touching local file 782 | exit 0 783 | fi 784 | 785 | if [[ "${download_type}" == 'page' ]]; then 786 | notification 'Opening download page…' 787 | open "${workflow_url}" 788 | exit 0 789 | fi 790 | 791 | readonly download_url="$( 792 | if [[ "${download_type}" == 'github_release' ]]; then 793 | osascript -l JavaScript -e 'function run(argv) { return JSON.parse(argv[0])["assets"].find(asset => asset["browser_download_url"].endsWith(".alfredworkflow"))["browser_download_url"] }' "$(curl --silent "https://api.github.com/repos/${workflow_url}/releases/latest")" 794 | else 795 | echo "${workflow_url}" 796 | fi 797 | )" 798 | 799 | if url_exists "${download_url}"; then 800 | notification 'Downloading and installing…' 801 | readonly download_name="$(basename "${download_url}")" 802 | curl --silent --location --output "${HOME}/Downloads/${download_name}" "${download_url}" 803 | open "${HOME}/Downloads/${download_name}" 804 | else 805 | abort "'workflow_url' (${download_url}) appears to not be reachable." 806 | fi 807 | fi 808 | scriptargtype 809 | 1 810 | scriptfile 811 | 812 | type 813 | 0 814 | 815 | type 816 | alfred.workflow.action.script 817 | uid 818 | A818751F-4F20-4FD1-87A9-C16C41723B16 819 | version 820 | 2 821 | 822 | 823 | config 824 | 825 | alfredfiltersresults 826 | 827 | alfredfiltersresultsmatchmode 828 | 0 829 | argumenttreatemptyqueryasnil 830 | 831 | argumenttrimmode 832 | 0 833 | argumenttype 834 | 1 835 | escaping 836 | 68 837 | keyword 838 | nt 839 | queuedelaycustom 840 | 3 841 | queuedelayimmediatelyinitially 842 | 843 | queuedelaymode 844 | 0 845 | queuemode 846 | 2 847 | runningsubtext 848 | Getting folders... 849 | script 850 | scope="hashtag" 851 | workflow_dir="$alfred_preferences/workflows/$alfred_workflow_uid" 852 | search_notes="$workflow_dir/search_notes/search_notes" 853 | if [[ ! -f "$workflow_dir/authorized" ]]; then 854 | xattr -rd com.apple.quarantine "$workflow_dir" 855 | touch "$workflow_dir/authorized" 856 | fi 857 | out=`"$search_notes" $scope "$@" 2>&1` 858 | if [[ $? != 0 ]]; then 859 | nl=$'\n' 860 | notes_db="$HOME/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite" 861 | macos="macOS: $(sw_vers -productVersion)${nl}" 862 | alf_version="Alfred: ${alfred_version}${nl}" 863 | workflow_version="Workflow: ${alfred_workflow_version}${nl}" 864 | cpu_arch="CPU: $(machine)${nl}" 865 | bin_xattrs="Binary xattrs: $(xattr "$search_notes")${nl}" 866 | db_xattrs="Notes DB xattrs: $(xattr "$notes_db")${nl}" 867 | bin_info="Binary info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$search_notes")${nl}" 868 | db_info="Notes DB info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$notes_db")${nl}" 869 | alfred_query="Query: $scope '$@'${nl}" 870 | osascript "$workflow_dir/handle_error.scpt" "Please copy this entire text if submitting an error report. You may need to scroll.${nl}${nl}${out}${nl}${nl}${macos}${alf_version}${workflow_version}${cpu_arch}${bin_xattrs}${db_xattrs}${bin_info}${db_info}${alfred_query}" 871 | else 872 | echo $out 873 | fi 874 | scriptargtype 875 | 1 876 | scriptfile 877 | get_folders.py 878 | subtext 879 | 880 | title 881 | Search note hashtags 882 | type 883 | 0 884 | withspace 885 | 886 | 887 | type 888 | alfred.workflow.input.scriptfilter 889 | uid 890 | CAA4E408-453B-4518-B2B1-CD024BAA493C 891 | version 892 | 3 893 | 894 | 895 | config 896 | 897 | applescript 898 | -- This script takes "URLs" of format "identifier,itemID,accountID,itemFolderID,userQuery" or just "userQuery" -- accountID can be the string "null", if so the default account is used -- Some commands need to run twice, otherwise they fail when toolbar search is active on alfred_script(q) try if q contains "/ICNote/p" or q contains "/ICFolder/p" then set AppleScript's text item delimiters to "," set identifier to text item 1 of q set itemID to text item 2 of q set accountID to text item 3 of q set itemFolderID to text item 4 of q set AppleScript's text item delimiters to "" tell application "Notes" if itemID contains "/ICNote/p" then 899 | if itemFolderID is not "null" then if accountID is "null" then show folder id itemFolderID in default account else show folder id itemFolderID in account id accountID end if 900 | end if -- Show user-requested note open location "notes://showNote?identifier=" & identifier open location "notes://showNote?identifier=" & identifier -- Compatibility with macOS < 11 which does not support notes:// set OSVersion to system version of (system info) set mainVersion to text 1 thru ((offset of "." in OSVersion) - 1) of OSVersion as number if mainVersion < 11 then if accountID is "null" then show note id itemID in default account show note id itemID in default account else show note id itemID in account id accountID show note id itemID in account id accountID end if end if else if itemID contains "/ICFolder/p" then -- Show user-requested folder if accountID is "null" then show folder id itemID in default account show folder id itemID in default account else show folder id itemID in account id accountID show folder id itemID in account id accountID end if end if end tell else tell application "Notes" 901 | show default folder in default account 902 | show default folder in default account 903 | delay 0.5 -- to avoid any still-pressed keys interfering 904 | end tell 905 | tell application "System Events" tell process "Notes" 906 | keystroke "n" using command down 907 | keystroke q 908 | key code {36, 36} -- enter, enter 909 | end tell 910 | end tell end if on error errorMessage number errorNumber display alert "Show Note Error" message ((errorNumber as string) & ": " & errorMessage & " 911 | 912 | Input: " & q) as critical end try end alfred_script 913 | cachescript 914 | 915 | 916 | type 917 | alfred.workflow.action.applescript 918 | uid 919 | 4D8E3444-14C2-4D0E-A8C1-AA67988AE358 920 | version 921 | 1 922 | 923 | 924 | config 925 | 926 | applescript 927 | -- This script takes "URLs" of format "identifier,itemID,accountID,itemFolderID,userQuery" 928 | -- accountID can be the string "null", if so the default account is used 929 | -- Some commands need to run twice, otherwise they fail when toolbar search is active 930 | 931 | on alfred_script(q) 932 | try 933 | set AppleScript's text item delimiters to "," 934 | set identifier to text item 1 of q 935 | set itemID to text item 2 of q 936 | set accountID to text item 3 of q 937 | set AppleScript's text item delimiters to "" 938 | tell application "Notes" 939 | -- Show user-requested folder 940 | set s to selection 941 | repeat with n in s 942 | if accountID is "null" then 943 | move n to folder id itemID in default account 944 | move n to folder id itemID in default account 945 | else 946 | move n to folder id itemID in account id accountID 947 | move n to folder id itemID in account id accountID 948 | end if 949 | end repeat 950 | end tell 951 | on error errorMessage number errorNumber 952 | display alert "Move Note to Folder Error" message ((errorNumber as string) & ": " & errorMessage & " 953 | 954 | Input: " & q) as critical 955 | end try 956 | end alfred_script 957 | cachescript 958 | 959 | 960 | type 961 | alfred.workflow.action.applescript 962 | uid 963 | 19CCE92E-2C07-4CB4-9874-E29AA3563F37 964 | version 965 | 1 966 | 967 | 968 | config 969 | 970 | argumenttype 971 | 0 972 | keyword 973 | nc 974 | subtext 975 | 976 | text 977 | Create new note '{query}' 978 | withspace 979 | 980 | 981 | type 982 | alfred.workflow.input.keyword 983 | uid 984 | 69AB99D4-3231-4959-828B-383C93051FCC 985 | version 986 | 1 987 | 988 | 989 | config 990 | 991 | applescript 992 | -- Some commands need to run twice, otherwise they fail when toolbar search is active 993 | 994 | on alfred_script(q) 995 | try 996 | tell application "Notes" 997 | show default folder in default account 998 | show default folder in default account 999 | delay 0.5 -- to avoid any still-pressed keys interfering 1000 | end tell 1001 | tell application "System Events" tell process "Notes" 1002 | keystroke "n" using command down 1003 | keystroke q 1004 | key code {36, 36} -- enter, enter 1005 | end tell 1006 | end tell 1007 | on error errorMessage number errorNumber 1008 | display alert "Create Note Error" message (errorNumber as string & ": " & errorMessage & "\n\nInput: " & q) as critical 1009 | end try 1010 | end alfred_script 1011 | cachescript 1012 | 1013 | 1014 | type 1015 | alfred.workflow.action.applescript 1016 | uid 1017 | 092EA403-A1D7-49DA-B8DD-8D785DDAB3B9 1018 | version 1019 | 1 1020 | 1021 | 1022 | config 1023 | 1024 | applescript 1025 | -- This script takes "URLs" of format "identifier,itemID,accountID,userQuery" 1026 | 1027 | use framework "Foundation" 1028 | use scripting additions 1029 | 1030 | property NSMutableAttributedString : a reference to current application's NSMutableAttributedString 1031 | property NSNull : a reference to current application's NSNull 1032 | property NSPasteboardTypeRTF : a reference to current application's NSPasteboardTypeRTF 1033 | property NSRTFTextDocumentType : a reference to current application's NSRTFTextDocumentType 1034 | property NSString : a reference to current application's NSString 1035 | property NSUTF8StringEncoding : a reference to current application's NSUTF8StringEncoding 1036 | 1037 | on HTMLToClipboard(HTMLContent) 1038 | set HTMLBody to ("<html><head><meta charset=\"UTF-8\" /></head><body>" & HTMLContent & "</body></html>") 1039 | set NSStringHTMLBody to NSString's stringWithString:HTMLBody 1040 | set HTMLBodyData to NSStringHTMLBody's dataUsingEncoding:NSUTF8StringEncoding 1041 | set attributedString to NSMutableAttributedString's alloc() 1042 | attributedString's initWithHTML:HTMLBodyData documentAttributes:NSNull 1043 | set range to {0, attributedString's |length|} 1044 | set RTF to (attributedString's RTFFromRange:range documentAttributes:{DocumentType:NSRTFTextDocumentType}) 1045 | set pasteboard to current application's NSPasteboard's generalPasteboard() 1046 | pasteboard's clearContents() 1047 | pasteboard's setData:RTF forType:NSPasteboardTypeRTF 1048 | end clipTextAndHtml 1049 | 1050 | on alfred_script(q) 1051 | try 1052 | set AppleScript's text item delimiters to "," 1053 | set identifier to text item 1 of q 1054 | set itemID to text item 2 of q 1055 | set accountID to text item 3 of q 1056 | set AppleScript's text item delimiters to "" 1057 | tell application "Notes" 1058 | if accountID is "null" then 1059 | set noteName to name of note id itemID in default account 1060 | else 1061 | set noteName to name of note id itemID in account id accountID 1062 | end if 1063 | set HTMLLink to "<a href=\"applenotes://note/" & identifier & "\">" & noteName & "</a>" 1064 | end tell 1065 | my HTMLToClipboard(HTMLLink) 1066 | tell application "System Events" to keystroke "v" using command down 1067 | on error errorMessage number errorNumber 1068 | display alert "Paste Link to Note Error" message (errorNumber as string & ": " & errorMessage & "\n\nInput: " & q) as critical 1069 | end try 1070 | end alfred_script 1071 | cachescript 1072 | 1073 | 1074 | type 1075 | alfred.workflow.action.applescript 1076 | uid 1077 | E91B4B80-CB26-4BC2-B808-5EC8A43F3E25 1078 | version 1079 | 1 1080 | 1081 | 1082 | config 1083 | 1084 | alfredfiltersresults 1085 | 1086 | alfredfiltersresultsmatchmode 1087 | 0 1088 | argumenttreatemptyqueryasnil 1089 | 1090 | argumenttrimmode 1091 | 0 1092 | argumenttype 1093 | 1 1094 | escaping 1095 | 68 1096 | queuedelaycustom 1097 | 3 1098 | queuedelayimmediatelyinitially 1099 | 1100 | queuedelaymode 1101 | 0 1102 | queuemode 1103 | 2 1104 | runningsubtext 1105 | Getting notes... 1106 | script 1107 | scope="title" 1108 | workflow_dir="$alfred_preferences/workflows/$alfred_workflow_uid" 1109 | search_notes="$workflow_dir/search_notes/search_notes" 1110 | if [[ ! -f "$workflow_dir/authorized" ]]; then 1111 | xattr -rd com.apple.quarantine "$workflow_dir" 1112 | touch "$workflow_dir/authorized" 1113 | fi 1114 | out=`"$search_notes" $scope "$@" 2>&1` 1115 | if [[ $? != 0 ]]; then 1116 | nl=$'\n' 1117 | notes_db="$HOME/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite" 1118 | macos="macOS: $(sw_vers -productVersion)${nl}" 1119 | alf_version="Alfred: ${alfred_version}${nl}" 1120 | workflow_version="Workflow: ${alfred_workflow_version}${nl}" 1121 | cpu_arch="CPU: $(machine)${nl}" 1122 | bin_xattrs="Binary xattrs: $(xattr "$search_notes")${nl}" 1123 | db_xattrs="Notes DB xattrs: $(xattr "$notes_db")${nl}" 1124 | bin_info="Binary info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$search_notes")${nl}" 1125 | db_info="Notes DB info: $(stat -f "%Mp%Lp %u/%Su %g/%Sg" "$notes_db")${nl}" 1126 | alfred_query="Query: $scope '$@'${nl}" 1127 | osascript "$workflow_dir/handle_error.scpt" "Please copy this entire text if submitting an error report. You may need to scroll.${nl}${nl}${out}${nl}${nl}${macos}${alf_version}${workflow_version}${cpu_arch}${bin_xattrs}${db_xattrs}${bin_info}${db_info}${alfred_query}" 1128 | else 1129 | echo $out 1130 | fi 1131 | scriptargtype 1132 | 1 1133 | scriptfile 1134 | cmd/search_titles/search_titles 1135 | subtext 1136 | 1137 | title 1138 | Search notes 1139 | type 1140 | 0 1141 | withspace 1142 | 1143 | 1144 | type 1145 | alfred.workflow.input.scriptfilter 1146 | uid 1147 | A057AD2C-473A-4823-8624-8891E5C187F6 1148 | version 1149 | 3 1150 | 1151 | 1152 | config 1153 | 1154 | focusedappvariable 1155 | 1156 | focusedappvariablename 1157 | 1158 | keyword 1159 | [[[ 1160 | 1161 | type 1162 | alfred.workflow.trigger.snippet 1163 | uid 1164 | 2A3C974B-57DF-4601-8EFC-4158CAA2005A 1165 | version 1166 | 1 1167 | 1168 | 1169 | readme 1170 | ## New in this version 1171 | - More robust new note creation 1172 | - Faster order of operations when showing a note in a folder 1173 | 1174 | ## Setup instructions and help 1175 | https://github.com/sballin/alfred-search-notes-app 1176 | 1177 | ## Environment variables 1178 | - fallbackCreateNew: 1 = offer to create a new note if none was found; 0 = don't 1179 | - fallbackSearchBody: 1 = if a title search returns no results, search note bodies too; 0 = don't 1180 | - searchFolders: in title search, 1 = return all notes from any folder matching the search query; 0 = don't 1181 | - sortByDate: 1 = most recently modified note first; 0 = alphabetical order 1182 | - showEnclosingFolder: 1 = when displaying a note, also take you to the folder it's in; 0 = don't 1183 | uidata 1184 | 1185 | 060809AF-8160-439A-85F9-D672664E3A1A 1186 | 1187 | xpos 1188 | 50 1189 | ypos 1190 | 160 1191 | 1192 | 092EA403-A1D7-49DA-B8DD-8D785DDAB3B9 1193 | 1194 | note 1195 | Create new note 1196 | xpos 1197 | 605 1198 | ypos 1199 | 800 1200 | 1201 | 19CCE92E-2C07-4CB4-9874-E29AA3563F37 1202 | 1203 | note 1204 | ⌥ Move note to folder 1205 | xpos 1206 | 605 1207 | ypos 1208 | 665 1209 | 1210 | 1A6D4810-ABAF-4604-9639-CC1327A279B7 1211 | 1212 | xpos 1213 | 50 1214 | ypos 1215 | 50 1216 | 1217 | 2A3C974B-57DF-4601-8EFC-4158CAA2005A 1218 | 1219 | note 1220 | Paste link to note 1221 | xpos 1222 | 50 1223 | ypos 1224 | 935 1225 | 1226 | 4D8E3444-14C2-4D0E-A8C1-AA67988AE358 1227 | 1228 | note 1229 | Show note/folder 1230 | or create note 1231 | xpos 1232 | 605 1233 | ypos 1234 | 515 1235 | 1236 | 5BC84589-FA2A-459F-982A-54B612C9BA7F 1237 | 1238 | note 1239 | Search note titles 1240 | xpos 1241 | 290 1242 | ypos 1243 | 105 1244 | 1245 | 6740BCB6-6818-49E2-A88A-9D19EA132F08 1246 | 1247 | note 1248 | ⌥ Copy link to note 1249 | xpos 1250 | 605 1251 | ypos 1252 | 245 1253 | 1254 | 69AB99D4-3231-4959-828B-383C93051FCC 1255 | 1256 | note 1257 | Create new note 1258 | xpos 1259 | 290 1260 | ypos 1261 | 800 1262 | 1263 | 6F3DD843-22EF-4A97-BAF8-511894B5202D 1264 | 1265 | note 1266 | Search folder names 1267 | xpos 1268 | 290 1269 | ypos 1270 | 375 1271 | 1272 | A057AD2C-473A-4823-8624-8891E5C187F6 1273 | 1274 | note 1275 | Search note titles 1276 | xpos 1277 | 290 1278 | ypos 1279 | 935 1280 | 1281 | A818751F-4F20-4FD1-87A9-C16C41723B16 1282 | 1283 | colorindex 1284 | 12 1285 | note 1286 | OneUpdater 1287 | xpos 1288 | 850 1289 | ypos 1290 | 430 1291 | 1292 | B9ECD7D6-EA33-4E2E-AE3E-4E22EEDD6097 1293 | 1294 | note 1295 | Search note bodies 1296 | xpos 1297 | 290 1298 | ypos 1299 | 240 1300 | 1301 | CAA4E408-453B-4518-B2B1-CD024BAA493C 1302 | 1303 | note 1304 | Search hashtags 1305 | xpos 1306 | 290 1307 | ypos 1308 | 510 1309 | 1310 | CE746687-24FD-4E5C-841F-0D4826E007C4 1311 | 1312 | note 1313 | ⇧ Search in Notes toolbar 1314 | xpos 1315 | 605 1316 | ypos 1317 | 95 1318 | 1319 | DC692798-E272-4547-BE83-4B63B823E456 1320 | 1321 | note 1322 | ⌘ Copy note body 1323 | xpos 1324 | 605 1325 | ypos 1326 | 380 1327 | 1328 | E91B4B80-CB26-4BC2-B808-5EC8A43F3E25 1329 | 1330 | note 1331 | Paste link to note 1332 | xpos 1333 | 605 1334 | ypos 1335 | 935 1336 | 1337 | 1338 | userconfigurationconfig 1339 | 1340 | variables 1341 | 1342 | fallbackCreateNew 1343 | 1 1344 | fallbackSearchBody 1345 | 1 1346 | searchFolders 1347 | 1 1348 | showEnclosingFolder 1349 | 1 1350 | sortByDate 1351 | 1 1352 | 1353 | version 1354 | 3.6.2 1355 | webaddress 1356 | https://github.com/sballin/alfred-search-notes-app 1357 | 1358 | 1359 | -------------------------------------------------------------------------------- /search_notes/Makefile: -------------------------------------------------------------------------------- 1 | # -ldflags... reduces binary size by removing debug symbols 2 | # -trimpath removes any references to absolute paths on the machine that did the compiling 3 | # CGO_ENABLED=1 is required by go-sqlite3 4 | FLAGS = -ldflags "-s -w" -trimpath 5 | 6 | .PHONY: universal current clean 7 | 8 | universal: search_notes_intel search_notes_apple 9 | # Create universal binary that works on both Intel and Apple CPUs 10 | lipo -create -output search_notes search_notes_intel search_notes_apple 11 | rm -f search_notes_intel search_notes_apple 12 | 13 | search_notes_apple: 14 | # Build for Apple CPUs 15 | CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build $(FLAGS) -o search_notes_apple 16 | 17 | search_notes_intel: 18 | # Build for Intel CPUs 19 | CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build $(FLAGS) -o search_notes_intel 20 | 21 | current: 22 | # Quicker build only for the current machine's architecture 23 | go build $(FLAGS) -o search_notes 24 | 25 | clean: 26 | rm -f search_notes search_notes_intel search_notes_apple 27 | -------------------------------------------------------------------------------- /search_notes/alfred/alfred.go: -------------------------------------------------------------------------------- 1 | /* Modified from github.com/drgrib/alfred so that quicklookurl can be "null" without quotes */ 2 | 3 | package alfred 4 | 5 | import ( 6 | "encoding/json" 7 | . "fmt" 8 | ) 9 | 10 | // Indent specifies the indent string used for the JSON output for String() and Run(). If set to "", no indentation will be used. 11 | var Indent = " " 12 | 13 | // Rerun specifies the "rerun" value. 14 | var Rerun float64 15 | 16 | // Variables specifies the script filter level "variables" object. 17 | var Variables = map[string]string{} 18 | 19 | // Items specifies the "items" array. It can be accessed and iterated directly. It can also be appended to directly or appended to using the convenience function Add(item). 20 | var Items = []Item{} 21 | 22 | // Icon specifies the "icon" field of an Item. 23 | type Icon struct { 24 | Type string `json:"type,omitempty"` 25 | Path string `json:"path,omitempty"` 26 | } 27 | 28 | // Mod specifies the values of an Item.Mods map for the "mods" object. 29 | type Mod struct { 30 | Variables map[string]string `json:"variables,omitempty"` 31 | Valid *bool `json:"valid,omitempty"` 32 | Arg string `json:"arg,omitempty"` 33 | Subtitle string `json:"subtitle,omitempty"` 34 | Icon *Icon `json:"icon,omitempty"` 35 | } 36 | 37 | // Text specifies the "text" field of an Item. 38 | type Text struct { 39 | Copy string `json:"copy,omitempty"` 40 | Largetype string `json:"largetype,omitempty"` 41 | } 42 | 43 | // Item specifies the members of the "items" array. 44 | type Item struct { 45 | Variables map[string]string `json:"variables,omitempty"` 46 | UID string `json:"uid,omitempty"` 47 | Title string `json:"title"` 48 | Subtitle string `json:"subtitle,omitempty"` 49 | Arg string `json:"arg,omitempty"` 50 | Icon *Icon `json:"icon,omitempty"` 51 | Autocomplete string `json:"autocomplete,omitempty"` 52 | Type string `json:"type,omitempty"` 53 | Valid *bool `json:"valid,omitempty"` 54 | Match string `json:"match,omitempty"` 55 | Mods map[string]Mod `json:"mods,omitempty"` 56 | Text *Text `json:"text,omitempty"` 57 | QuicklookURL string `json:"quicklookurl"` 58 | } 59 | 60 | // Bool is a convenience function for filling optional bool values. 61 | func Bool(b bool) *bool { 62 | return &b 63 | } 64 | 65 | // Add is a convenience function for adding new Item instances to Items. 66 | func Add(item Item) { 67 | Items = append(Items, item) 68 | } 69 | 70 | type output struct { 71 | Rerun float64 `json:"rerun,omitempty"` 72 | Variables map[string]string `json:"variables,omitempty"` 73 | Items []Item `json:"items"` 74 | } 75 | 76 | // String returns the JSON for currently populated values or the minimum required values. 77 | func String() string { 78 | output := output{ 79 | Rerun: Rerun, 80 | Variables: Variables, 81 | Items: Items, 82 | } 83 | var err error 84 | var b []byte 85 | if Indent == "" { 86 | b, err = json.Marshal(output) 87 | } else { 88 | b, err = json.MarshalIndent(output, "", Indent) 89 | } 90 | if err != nil { 91 | messageErr := Errorf("Error in parser. Please report this output to https://github.com/drgrib/alfred/issues: %v", err) 92 | panic(messageErr) 93 | } 94 | s := string(b) 95 | return s 96 | } 97 | 98 | // Run prints the result of String() to standard output for debugging or direct consumption by an Alfred script filter. 99 | func Run() { 100 | Println(String()) 101 | } 102 | -------------------------------------------------------------------------------- /search_notes/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/sballin/alfred-search-notes-app 2 | 3 | go 1.21.5 4 | 5 | require ( 6 | github.com/golang/protobuf v1.5.3 7 | github.com/mattn/go-sqlite3 v1.14.16 8 | golang.org/x/text v0.14.0 9 | google.golang.org/protobuf v1.32.0 10 | ) 11 | 12 | require google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect 13 | -------------------------------------------------------------------------------- /search_notes/go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 3 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 4 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 5 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 6 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 7 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 8 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 9 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 10 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 11 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 12 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 13 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 14 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 15 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 16 | github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0= 17 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 18 | github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= 19 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 20 | github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= 21 | github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 22 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 23 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 24 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 25 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 26 | github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= 27 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 28 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 29 | github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= 30 | github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= 31 | github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= 32 | github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= 33 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 34 | github.com/sballin/alfred-search-notes-app v0.0.0-20200820151921-a6ee3ac89963 h1:cFtiHzyAtaPptF8Wbr/oKx13QII2njVuE6MnhoRXpN0= 35 | github.com/sballin/alfred-search-notes-app v0.0.0-20200820151921-a6ee3ac89963/go.mod h1:KX+q/mUXDlpP4A7Kgm7mKwI27No5O+P6DdmSDcQLlLs= 36 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 37 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 38 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 39 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 40 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 41 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 42 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 43 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 44 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 45 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 46 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 47 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 48 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 49 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 50 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 51 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 52 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 53 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 54 | golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= 55 | golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 56 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 57 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 58 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 59 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 60 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 61 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= 62 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 63 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 64 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 65 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 66 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 67 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 68 | google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= 69 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 70 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 71 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 72 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 73 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 74 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 75 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 76 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 77 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 78 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 79 | google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= 80 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 81 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 82 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 83 | google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= 84 | google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 85 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 86 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 87 | -------------------------------------------------------------------------------- /search_notes/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "compress/gzip" 6 | "database/sql" 7 | "fmt" 8 | "io" 9 | "os" 10 | "os/user" 11 | "path/filepath" 12 | "strings" 13 | "unicode" 14 | 15 | "golang.org/x/text/language" 16 | "golang.org/x/text/search" 17 | "golang.org/x/text/unicode/norm" 18 | "google.golang.org/protobuf/proto" 19 | 20 | _ "github.com/mattn/go-sqlite3" 21 | "github.com/sballin/alfred-search-notes-app/alfred" 22 | notestore "github.com/sballin/alfred-search-notes-app/proto" 23 | ) 24 | 25 | var matcher = search.New(language.Und, search.Loose) 26 | 27 | const ( 28 | DbPath = "~/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite" 29 | TitleKey = "title" // titles of rows in Alfred 30 | SubtitleKey = "subtitle" // subtitles of rows in Alfred 31 | ArgKey = "arg" // comma-separated lists of identifiers that wind up in Alfred "arg" fields 32 | BodyKey = "noteBodyZipped" 33 | TableTextKey = "tableText" 34 | NotesSQLTemplate = ` 35 | SELECT 36 | noteTitle AS title, 37 | folderTitle AS subtitle, 38 | identifier || ',' || -- note ID used in notes:// and applenotes:// URI schemes 39 | 'x-coredata://' || z_uuid || '/ICNote/p' || xcoreDataID || ',' || -- applescript ID of note 40 | IFNULL('x-coredata://' || z_uuid || '/ICAccount/p' || accountID, 'null') || ',' || -- applescript ID of account 41 | %s -- applescript ID of folder that note is in or "null" 42 | AS arg, 43 | noteBodyZipped, 44 | tableText, 45 | CAST(xcoreDataID AS TEXT) 46 | FROM ( 47 | SELECT 48 | c.ztitle1 AS noteTitle, 49 | c.zfolder AS noteFolderID, 50 | c.zmodificationdate1 AS modDate, 51 | c.z_pk AS xcoredataID, 52 | c.zaccount3 AS accountID, 53 | c.zidentifier AS identifier, 54 | n.zdata AS noteBodyZipped 55 | FROM 56 | ziccloudsyncingobject AS c 57 | INNER JOIN zicnotedata AS n ON c.znotedata = n.z_pk -- note id (int) distinct from xcoredataID 58 | WHERE 59 | noteTitle IS NOT NULL AND 60 | modDate IS NOT NULL AND 61 | xcoredataID IS NOT NULL AND 62 | noteBodyZipped IS NOT NULL AND 63 | c.zmarkedfordeletion != 1 64 | ) AS notes 65 | INNER JOIN ( 66 | SELECT 67 | z_pk AS folderID, 68 | ztitle2 AS folderTitle, 69 | zfoldertype AS isRecentlyDeletedFolder 70 | FROM ziccloudsyncingobject 71 | WHERE 72 | folderTitle IS NOT NULL AND 73 | isRecentlyDeletedFolder != 1 AND 74 | zmarkedfordeletion != 1 75 | ) AS folders ON noteFolderID = folderID 76 | LEFT JOIN ( 77 | SELECT 78 | GROUP_CONCAT(zsummary, '') AS tableText, 79 | znote 80 | FROM ziccloudsyncingobject 81 | WHERE ztypeuti = 'com.apple.notes.table' 82 | GROUP BY znote 83 | ) AS tables ON znote = xcoreDataID 84 | LEFT JOIN ( 85 | SELECT z_uuid FROM z_metadata 86 | ) 87 | ORDER BY %s 88 | ` 89 | 90 | OCRsSQL = ` 91 | SELECT 92 | CAST(znote AS TEXT), 93 | IFNULL(GROUP_CONCAT(zhandwritingsummary, ''), '') || IFNULL(GROUP_CONCAT(zocrsummary, ''), '') 94 | FROM ziccloudsyncingobject 95 | WHERE (zocrsummary IS NOT NULL OR 96 | zhandwritingsummary IS NOT NULL) AND 97 | zmarkedfordeletion != 1 98 | GROUP BY znote 99 | ` 100 | 101 | HashtagsSQL = ` 102 | SELECT 103 | CAST(znote1 AS TEXT), 104 | GROUP_CONCAT(zalttext, ' ') 105 | FROM ziccloudsyncingobject 106 | WHERE ztypeuti1 = 'com.apple.notes.inlinetextattachment.hashtag' 107 | GROUP BY znote1 108 | ` 109 | 110 | FoldersSQLTemplate = ` 111 | SELECT 112 | ztitle2 AS title, 113 | '' AS subtitle, 114 | zidentifier || ',x-coredata://' || z_uuid || '/ICFolder/p' || z_pk || ',' || IFNULL('x-coredata://' || z_uuid || '/ICAccount/p' || zaccount4, 'null') AS arg 115 | FROM ziccloudsyncingobject 116 | LEFT JOIN ( 117 | SELECT z_uuid FROM z_metadata 118 | ) 119 | WHERE 120 | title IS NOT NULL AND 121 | zmarkedfordeletion != 1 AND 122 | zneedsinitialfetchfromcloud != 1 -- some phantom folders can show up in the results 123 | ORDER BY title ASC 124 | ` 125 | ) 126 | 127 | type LiteDB struct { 128 | db *sql.DB 129 | } 130 | 131 | type UserQuery struct { 132 | Tokens []string 133 | WordString string 134 | } 135 | 136 | func min(a, b int) int { 137 | if a < b { 138 | return a 139 | } 140 | return b 141 | } 142 | 143 | func Escape(s string) string { 144 | return strings.Replace(s, "'", "''", -1) 145 | } 146 | 147 | func Expanduser(path string) string { 148 | usr, _ := user.Current() 149 | dir := usr.HomeDir 150 | if path[:2] == "~/" { 151 | path = filepath.Join(dir, path[2:]) 152 | } 153 | return path 154 | } 155 | 156 | func NewLiteDB(path string) (LiteDB, error) { 157 | db, err := sql.Open("sqlite3", path) 158 | litedb := LiteDB{db} 159 | return litedb, err 160 | } 161 | 162 | func NewNotesDB() (LiteDB, error) { 163 | path := Expanduser(DbPath) 164 | litedb, err := NewLiteDB("file:" + path + "?mode=ro&_query_only=true") 165 | return litedb, err 166 | } 167 | 168 | func SafeUnicode(r rune) rune { 169 | // Keep graphic characters and newlines 170 | if unicode.IsGraphic(r) || r == '\n' { 171 | return r 172 | } else { 173 | return -1 174 | } 175 | } 176 | 177 | func GetNoteBody(noteBytes []byte) string { 178 | body := "" 179 | note := ¬estore.NoteStoreProto{} 180 | err := proto.Unmarshal(noteBytes, note) 181 | if err != nil { 182 | return "" 183 | } 184 | if note.Document.Note.NoteText != nil { 185 | body += *note.Document.Note.NoteText 186 | for _, a := range note.Document.Note.AttributeRun { 187 | if a.Link != nil { 188 | body += "\n" + *a.Link 189 | } 190 | } 191 | // Remove title from body 192 | bodyStart := strings.Index(body, "\n") 193 | if bodyStart > 0 { 194 | body = body[bodyStart:] 195 | } 196 | // Remove object substitution character 197 | body = strings.ReplaceAll(body, string([]byte{239, 191, 188}), "") 198 | // Remove any weird characters that might be left over 199 | body = strings.Map(SafeUnicode, body) 200 | body = norm.NFC.String(strings.ToValidUTF8(body, "")) 201 | } 202 | return body 203 | } 204 | 205 | func SubtitleMatchSummary(body string, search string) string { 206 | matchSummary := " | …" 207 | i := 0 208 | j := 0 209 | k := 0 210 | for i >= 0 && j >= 0 && len(matchSummary) < 400 { 211 | j, k = matcher.IndexString(body[i:], search) 212 | if j >= 0 { 213 | // Include context around match up to rb or next newline 214 | rb := min(len(body), i+k+25) 215 | nextNewline := strings.Index(body[i+j:rb], "\n") 216 | if nextNewline > 0 { 217 | rb = i + j + nextNewline 218 | } 219 | match := strings.ToValidUTF8(strings.Trim(body[i+j:rb], " "), "") 220 | matchSummary += match + "…" 221 | i = rb 222 | } 223 | } 224 | return matchSummary 225 | } 226 | 227 | func (lite LiteDB) GetSpecialColumn(query string) (map[string]string, error) { 228 | results := map[string]string{} 229 | rows, err := lite.db.Query(query) 230 | if err != nil { 231 | return results, err 232 | } 233 | defer rows.Close() 234 | cols, err := rows.Columns() 235 | if err != nil { 236 | return results, err 237 | } 238 | for rows.Next() { 239 | columns := make([]interface{}, len(cols)) 240 | columnPointers := make([]interface{}, len(cols)) 241 | for i := range columns { 242 | columnPointers[i] = &columns[i] 243 | } 244 | if err := rows.Scan(columnPointers...); err != nil { 245 | continue 246 | } 247 | valNoteID := columnPointers[0].(*interface{}) 248 | noteID, ok := (*valNoteID).(string) 249 | if !ok { 250 | continue 251 | } 252 | valSpecialColumn := columnPointers[1].(*interface{}) 253 | specialColumn, ok := (*valSpecialColumn).(string) 254 | if !ok { 255 | continue 256 | } 257 | results[noteID] = specialColumn 258 | } 259 | return results, nil 260 | } 261 | 262 | func (lite LiteDB) GetResults(search string, scope string) ([]map[string]string, error) { 263 | // Format SQL query 264 | sqlQuery := fmt.Sprintf(NotesSQLTemplate, GetEnclosingFolderPreference(), GetOrderPreference()) 265 | if scope == "folder" { 266 | sqlQuery = FoldersSQLTemplate 267 | } 268 | 269 | // Get OCR text 270 | OCRs := map[string]string{} 271 | if scope == "body" { 272 | OCRs, _ = lite.GetSpecialColumn(OCRsSQL) 273 | } 274 | 275 | // Get hashtags 276 | hashtags := map[string]string{} 277 | if scope == "body" || scope == "hashtag" { 278 | hashtags, _ = lite.GetSpecialColumn(HashtagsSQL) 279 | } 280 | 281 | // Run query to get all results 282 | results := []map[string]string{} 283 | rows, err := lite.db.Query(sqlQuery) 284 | if err != nil { 285 | return results, err 286 | } 287 | defer rows.Close() 288 | cols, err := rows.Columns() 289 | if err != nil { 290 | return results, err 291 | } 292 | 293 | searchFolders := false 294 | if os.Getenv("searchFolders") != "0" { 295 | searchFolders = true 296 | } 297 | 298 | gzipHeader := []byte{31, 139, 8, 0, 0, 0, 0, 0, 0, 19} 299 | bytesReader := bytes.NewReader(gzipHeader) 300 | gzipReader, err := gzip.NewReader(bytesReader) 301 | if err != nil && scope == "body" { 302 | return results, err 303 | } 304 | 305 | for rows.Next() { 306 | m := map[string]string{} 307 | columns := make([]interface{}, len(cols)) 308 | columnPointers := make([]interface{}, len(cols)) 309 | for i := range columns { 310 | columnPointers[i] = &columns[i] 311 | } 312 | if err := rows.Scan(columnPointers...); err != nil { 313 | continue 314 | } 315 | 316 | hashtagText := "" 317 | scopeText := "" 318 | matchSummary := "" 319 | if len(search) > 0 { 320 | ocrText := "" 321 | if scope == "body" || scope == "hashtag" { 322 | // Get note ID and OCR text 323 | valNoteID := columnPointers[5].(*interface{}) 324 | noteID, ok := (*valNoteID).(string) 325 | if ok { 326 | ocrText = OCRs[noteID] 327 | hashtagText = hashtags[noteID] 328 | } 329 | } 330 | 331 | // Add note/folder title to search scope 332 | valTitle := columnPointers[0].(*interface{}) 333 | title, ok := (*valTitle).(string) 334 | if !ok { 335 | continue 336 | } 337 | scopeText = title 338 | if searchFolders { 339 | // Add folder of note object to search scope (this field is empty for folder objects) 340 | valFolder := columnPointers[1].(*interface{}) 341 | folder, ok := (*valFolder).(string) 342 | if !ok { 343 | folder = "" 344 | } 345 | scopeText += " " + folder 346 | } 347 | if scope == "hashtag" { 348 | // Return notes matching every hash tag provided 349 | searchTags := strings.Split(search, " ") 350 | containsSearchTag := true 351 | for _, searchTag := range searchTags { 352 | firstMatch, _ := matcher.IndexString(hashtagText, "#"+searchTag) 353 | if firstMatch == -1 { 354 | containsSearchTag = false 355 | } 356 | } 357 | if !containsSearchTag { 358 | continue 359 | } 360 | } else { 361 | if scope == "body" { 362 | // Decompress note body data 363 | valBody := columnPointers[3].(*interface{}) 364 | noteDataZippedBytes, ok := (*valBody).([]byte) 365 | if ok { 366 | bytesReader.Reset(noteDataZippedBytes) 367 | errReset := gzipReader.Reset(bytesReader) 368 | if errReset == nil { 369 | noteBytes, errRead := io.ReadAll(gzipReader) 370 | if errRead == nil { 371 | // Get plaintext of any tables in this note 372 | valTableText := columnPointers[4].(*interface{}) 373 | tableText, ok := (*valTableText).(string) 374 | if !ok { 375 | tableText = "" 376 | } 377 | // Extract protobuf-format data from unzipped note and add other text 378 | body := hashtagText + " " + GetNoteBody(noteBytes) + " " + tableText + " " + ocrText 379 | // Add body text to search scope 380 | scopeText += " " + body 381 | // Prepare result summary for subtitle string 382 | firstMatch, _ := matcher.IndexString(body, search) 383 | if firstMatch >= 0 { 384 | matchSummary = SubtitleMatchSummary(body, search) 385 | } 386 | } 387 | } 388 | } 389 | } 390 | firstMatch, _ := matcher.IndexString(scopeText, search) 391 | if firstMatch == -1 { 392 | continue 393 | } 394 | } 395 | } 396 | 397 | // If we get here, the note/folder contains a match. Add it to the Alfred results. 398 | for i, colName := range cols { 399 | // Don't add note body data to future alfred row 400 | if colName == BodyKey { 401 | continue 402 | } 403 | 404 | val := columnPointers[i].(*interface{}) 405 | s, ok := (*val).(string) 406 | if ok { 407 | m[colName] = s 408 | } else { 409 | m[colName] = "" 410 | } 411 | } 412 | 413 | // Add additional text to subtitle string 414 | if hashtagText != "" { 415 | hashtagText = " " + hashtagText 416 | } 417 | m[SubtitleKey] += hashtagText 418 | m[SubtitleKey] += matchSummary 419 | 420 | results = append(results, m) 421 | } 422 | return results, err 423 | } 424 | 425 | func RowToItem(row map[string]string, userQuery UserQuery) alfred.Item { 426 | return alfred.Item{ 427 | Title: row[TitleKey], 428 | Subtitle: row[SubtitleKey], 429 | Arg: row[ArgKey] + "," + Escape(userQuery.WordString), 430 | QuicklookURL: " ", 431 | } 432 | } 433 | 434 | func CreateNoteItem(userQuery UserQuery) (*alfred.Item, error) { 435 | title := userQuery.WordString 436 | item := alfred.Item{ 437 | Title: title, 438 | Arg: title, 439 | Subtitle: "Create new note", 440 | } 441 | return &item, nil 442 | } 443 | 444 | func ParseUserQuery(arg string) UserQuery { 445 | userQuery := UserQuery{} 446 | userQuery.Tokens = strings.Split(norm.NFC.String(arg), " ") 447 | words := []string{} 448 | for _, e := range userQuery.Tokens { 449 | if e != "" { 450 | words = append(words, e) 451 | } 452 | } 453 | userQuery.WordString = strings.Join(words, " ") 454 | return userQuery 455 | } 456 | 457 | func GetEnclosingFolderPreference() string { 458 | if os.Getenv("showEnclosingFolder") != "0" { 459 | return "'x-coredata://' || z_uuid || '/ICFolder/p' || noteFolderID" 460 | } else { 461 | return "'null'" 462 | } 463 | } 464 | 465 | func GetOrderPreference() string { 466 | if os.Getenv("sortByDate") != "0" { 467 | return "modDate DESC" 468 | } else { 469 | return "lower(noteTitle) ASC" 470 | } 471 | } 472 | 473 | func PanicOnErr(err error) { 474 | if err != nil { 475 | panic(err) 476 | } 477 | } 478 | 479 | func main() { 480 | if len(os.Args) >= 3 { 481 | litedb, err := NewNotesDB() 482 | PanicOnErr(err) 483 | 484 | scope := os.Args[1] 485 | userQuery := ParseUserQuery(os.Args[2]) 486 | 487 | searchRows, err := litedb.GetResults(userQuery.WordString, scope) 488 | PanicOnErr(err) 489 | 490 | if os.Getenv("fallbackCreateNew") == "1" && (scope == "title" || scope == "body") && len(searchRows) == 0 { 491 | createItem, err := CreateNoteItem(userQuery) 492 | PanicOnErr(err) 493 | alfred.Add(*createItem) 494 | } 495 | 496 | if os.Getenv("fallbackSearchBody") == "1" && scope == "title" && len(searchRows) == 0 { 497 | searchRows, err = litedb.GetResults(userQuery.WordString, "body") 498 | PanicOnErr(err) 499 | } 500 | 501 | if len(searchRows) > 0 { 502 | for _, row := range searchRows { 503 | alfred.Add(RowToItem(row, userQuery)) 504 | } 505 | } 506 | 507 | alfred.Run() 508 | } 509 | } 510 | -------------------------------------------------------------------------------- /search_notes/proto/README.md: -------------------------------------------------------------------------------- 1 | ## Acknowledgement 2 | 3 | The notestore.proto file is copied from the [apple_cloud_notes_parser](https://github.com/threeplanetssoftware/apple_cloud_notes_parser/tree/master/proto) project. 4 | 5 | ## Building 6 | 7 | To get the protoc command, do 8 | 9 | brew install protobuf 10 | go install google.golang.org/protobuf/cmd/protoc-gen-go 11 | 12 | Then in this folder, do 13 | 14 | protoc -I=. --go_out=. notestore.proto 15 | 16 | ## Development 17 | 18 | To play around with parsing protobuf, see [protobuf-inspector](https://github.com/jmendeth/protobuf-inspector) and this [protobuf_config.py](https://github.com/threeplanetssoftware/apple_cloud_notes_parser/blob/master/proto/protobuf_config.py) file. Use DB Browser for SQLite.app to save some zipped note data to disk, rename the file as .gz and do gunzip, then in protobuf-inspector do 19 | 20 | ./main.py < file 21 | -------------------------------------------------------------------------------- /search_notes/proto/notestore.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.25.0 4 | // protoc v3.12.3 5 | // source: notestore.proto 6 | 7 | package notestore 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | //Represents a color 24 | type Color struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | Red *float32 `protobuf:"fixed32,1,req,name=red" json:"red,omitempty"` 30 | Green *float32 `protobuf:"fixed32,2,req,name=green" json:"green,omitempty"` 31 | Blue *float32 `protobuf:"fixed32,3,req,name=blue" json:"blue,omitempty"` 32 | Alpha *float32 `protobuf:"fixed32,4,req,name=alpha" json:"alpha,omitempty"` 33 | } 34 | 35 | func (x *Color) Reset() { 36 | *x = Color{} 37 | if protoimpl.UnsafeEnabled { 38 | mi := &file_notestore_proto_msgTypes[0] 39 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 40 | ms.StoreMessageInfo(mi) 41 | } 42 | } 43 | 44 | func (x *Color) String() string { 45 | return protoimpl.X.MessageStringOf(x) 46 | } 47 | 48 | func (*Color) ProtoMessage() {} 49 | 50 | func (x *Color) ProtoReflect() protoreflect.Message { 51 | mi := &file_notestore_proto_msgTypes[0] 52 | if protoimpl.UnsafeEnabled && x != nil { 53 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 54 | if ms.LoadMessageInfo() == nil { 55 | ms.StoreMessageInfo(mi) 56 | } 57 | return ms 58 | } 59 | return mi.MessageOf(x) 60 | } 61 | 62 | // Deprecated: Use Color.ProtoReflect.Descriptor instead. 63 | func (*Color) Descriptor() ([]byte, []int) { 64 | return file_notestore_proto_rawDescGZIP(), []int{0} 65 | } 66 | 67 | func (x *Color) GetRed() float32 { 68 | if x != nil && x.Red != nil { 69 | return *x.Red 70 | } 71 | return 0 72 | } 73 | 74 | func (x *Color) GetGreen() float32 { 75 | if x != nil && x.Green != nil { 76 | return *x.Green 77 | } 78 | return 0 79 | } 80 | 81 | func (x *Color) GetBlue() float32 { 82 | if x != nil && x.Blue != nil { 83 | return *x.Blue 84 | } 85 | return 0 86 | } 87 | 88 | func (x *Color) GetAlpha() float32 { 89 | if x != nil && x.Alpha != nil { 90 | return *x.Alpha 91 | } 92 | return 0 93 | } 94 | 95 | // Represents an attachment (embedded object) 96 | type AttachmentInfo struct { 97 | state protoimpl.MessageState 98 | sizeCache protoimpl.SizeCache 99 | unknownFields protoimpl.UnknownFields 100 | 101 | AttachmentIdentifier *string `protobuf:"bytes,1,opt,name=attachment_identifier,json=attachmentIdentifier" json:"attachment_identifier,omitempty"` 102 | TypeUti *string `protobuf:"bytes,2,opt,name=type_uti,json=typeUti" json:"type_uti,omitempty"` 103 | } 104 | 105 | func (x *AttachmentInfo) Reset() { 106 | *x = AttachmentInfo{} 107 | if protoimpl.UnsafeEnabled { 108 | mi := &file_notestore_proto_msgTypes[1] 109 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 110 | ms.StoreMessageInfo(mi) 111 | } 112 | } 113 | 114 | func (x *AttachmentInfo) String() string { 115 | return protoimpl.X.MessageStringOf(x) 116 | } 117 | 118 | func (*AttachmentInfo) ProtoMessage() {} 119 | 120 | func (x *AttachmentInfo) ProtoReflect() protoreflect.Message { 121 | mi := &file_notestore_proto_msgTypes[1] 122 | if protoimpl.UnsafeEnabled && x != nil { 123 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 124 | if ms.LoadMessageInfo() == nil { 125 | ms.StoreMessageInfo(mi) 126 | } 127 | return ms 128 | } 129 | return mi.MessageOf(x) 130 | } 131 | 132 | // Deprecated: Use AttachmentInfo.ProtoReflect.Descriptor instead. 133 | func (*AttachmentInfo) Descriptor() ([]byte, []int) { 134 | return file_notestore_proto_rawDescGZIP(), []int{1} 135 | } 136 | 137 | func (x *AttachmentInfo) GetAttachmentIdentifier() string { 138 | if x != nil && x.AttachmentIdentifier != nil { 139 | return *x.AttachmentIdentifier 140 | } 141 | return "" 142 | } 143 | 144 | func (x *AttachmentInfo) GetTypeUti() string { 145 | if x != nil && x.TypeUti != nil { 146 | return *x.TypeUti 147 | } 148 | return "" 149 | } 150 | 151 | // Represents a font 152 | type Font struct { 153 | state protoimpl.MessageState 154 | sizeCache protoimpl.SizeCache 155 | unknownFields protoimpl.UnknownFields 156 | 157 | FontName *string `protobuf:"bytes,1,opt,name=font_name,json=fontName" json:"font_name,omitempty"` 158 | PointSize *float32 `protobuf:"fixed32,2,opt,name=point_size,json=pointSize" json:"point_size,omitempty"` 159 | FontHints *int32 `protobuf:"varint,3,opt,name=font_hints,json=fontHints" json:"font_hints,omitempty"` 160 | } 161 | 162 | func (x *Font) Reset() { 163 | *x = Font{} 164 | if protoimpl.UnsafeEnabled { 165 | mi := &file_notestore_proto_msgTypes[2] 166 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 167 | ms.StoreMessageInfo(mi) 168 | } 169 | } 170 | 171 | func (x *Font) String() string { 172 | return protoimpl.X.MessageStringOf(x) 173 | } 174 | 175 | func (*Font) ProtoMessage() {} 176 | 177 | func (x *Font) ProtoReflect() protoreflect.Message { 178 | mi := &file_notestore_proto_msgTypes[2] 179 | if protoimpl.UnsafeEnabled && x != nil { 180 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 181 | if ms.LoadMessageInfo() == nil { 182 | ms.StoreMessageInfo(mi) 183 | } 184 | return ms 185 | } 186 | return mi.MessageOf(x) 187 | } 188 | 189 | // Deprecated: Use Font.ProtoReflect.Descriptor instead. 190 | func (*Font) Descriptor() ([]byte, []int) { 191 | return file_notestore_proto_rawDescGZIP(), []int{2} 192 | } 193 | 194 | func (x *Font) GetFontName() string { 195 | if x != nil && x.FontName != nil { 196 | return *x.FontName 197 | } 198 | return "" 199 | } 200 | 201 | func (x *Font) GetPointSize() float32 { 202 | if x != nil && x.PointSize != nil { 203 | return *x.PointSize 204 | } 205 | return 0 206 | } 207 | 208 | func (x *Font) GetFontHints() int32 { 209 | if x != nil && x.FontHints != nil { 210 | return *x.FontHints 211 | } 212 | return 0 213 | } 214 | 215 | // Styles a "Paragraph" (any run of characters in an AttributeRun) 216 | type ParagraphStyle struct { 217 | state protoimpl.MessageState 218 | sizeCache protoimpl.SizeCache 219 | unknownFields protoimpl.UnknownFields 220 | 221 | StyleType *int32 `protobuf:"varint,1,opt,name=style_type,json=styleType,def=-1" json:"style_type,omitempty"` 222 | Alignment *int32 `protobuf:"varint,2,opt,name=alignment" json:"alignment,omitempty"` 223 | IndentAmount *int32 `protobuf:"varint,4,opt,name=indent_amount,json=indentAmount" json:"indent_amount,omitempty"` 224 | Checklist *Checklist `protobuf:"bytes,5,opt,name=checklist" json:"checklist,omitempty"` 225 | } 226 | 227 | // Default values for ParagraphStyle fields. 228 | const ( 229 | Default_ParagraphStyle_StyleType = int32(-1) 230 | ) 231 | 232 | func (x *ParagraphStyle) Reset() { 233 | *x = ParagraphStyle{} 234 | if protoimpl.UnsafeEnabled { 235 | mi := &file_notestore_proto_msgTypes[3] 236 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 237 | ms.StoreMessageInfo(mi) 238 | } 239 | } 240 | 241 | func (x *ParagraphStyle) String() string { 242 | return protoimpl.X.MessageStringOf(x) 243 | } 244 | 245 | func (*ParagraphStyle) ProtoMessage() {} 246 | 247 | func (x *ParagraphStyle) ProtoReflect() protoreflect.Message { 248 | mi := &file_notestore_proto_msgTypes[3] 249 | if protoimpl.UnsafeEnabled && x != nil { 250 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 251 | if ms.LoadMessageInfo() == nil { 252 | ms.StoreMessageInfo(mi) 253 | } 254 | return ms 255 | } 256 | return mi.MessageOf(x) 257 | } 258 | 259 | // Deprecated: Use ParagraphStyle.ProtoReflect.Descriptor instead. 260 | func (*ParagraphStyle) Descriptor() ([]byte, []int) { 261 | return file_notestore_proto_rawDescGZIP(), []int{3} 262 | } 263 | 264 | func (x *ParagraphStyle) GetStyleType() int32 { 265 | if x != nil && x.StyleType != nil { 266 | return *x.StyleType 267 | } 268 | return Default_ParagraphStyle_StyleType 269 | } 270 | 271 | func (x *ParagraphStyle) GetAlignment() int32 { 272 | if x != nil && x.Alignment != nil { 273 | return *x.Alignment 274 | } 275 | return 0 276 | } 277 | 278 | func (x *ParagraphStyle) GetIndentAmount() int32 { 279 | if x != nil && x.IndentAmount != nil { 280 | return *x.IndentAmount 281 | } 282 | return 0 283 | } 284 | 285 | func (x *ParagraphStyle) GetChecklist() *Checklist { 286 | if x != nil { 287 | return x.Checklist 288 | } 289 | return nil 290 | } 291 | 292 | // Represents a checklist item 293 | type Checklist struct { 294 | state protoimpl.MessageState 295 | sizeCache protoimpl.SizeCache 296 | unknownFields protoimpl.UnknownFields 297 | 298 | Uuid []byte `protobuf:"bytes,1,req,name=uuid" json:"uuid,omitempty"` 299 | Done *int32 `protobuf:"varint,2,req,name=done" json:"done,omitempty"` 300 | } 301 | 302 | func (x *Checklist) Reset() { 303 | *x = Checklist{} 304 | if protoimpl.UnsafeEnabled { 305 | mi := &file_notestore_proto_msgTypes[4] 306 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 307 | ms.StoreMessageInfo(mi) 308 | } 309 | } 310 | 311 | func (x *Checklist) String() string { 312 | return protoimpl.X.MessageStringOf(x) 313 | } 314 | 315 | func (*Checklist) ProtoMessage() {} 316 | 317 | func (x *Checklist) ProtoReflect() protoreflect.Message { 318 | mi := &file_notestore_proto_msgTypes[4] 319 | if protoimpl.UnsafeEnabled && x != nil { 320 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 321 | if ms.LoadMessageInfo() == nil { 322 | ms.StoreMessageInfo(mi) 323 | } 324 | return ms 325 | } 326 | return mi.MessageOf(x) 327 | } 328 | 329 | // Deprecated: Use Checklist.ProtoReflect.Descriptor instead. 330 | func (*Checklist) Descriptor() ([]byte, []int) { 331 | return file_notestore_proto_rawDescGZIP(), []int{4} 332 | } 333 | 334 | func (x *Checklist) GetUuid() []byte { 335 | if x != nil { 336 | return x.Uuid 337 | } 338 | return nil 339 | } 340 | 341 | func (x *Checklist) GetDone() int32 { 342 | if x != nil && x.Done != nil { 343 | return *x.Done 344 | } 345 | return 0 346 | } 347 | 348 | // Represents an object that has pointers to a key and a value, asserting 349 | // somehow that the key object has to do with the value object. 350 | type DictionaryElement struct { 351 | state protoimpl.MessageState 352 | sizeCache protoimpl.SizeCache 353 | unknownFields protoimpl.UnknownFields 354 | 355 | Key *ObjectID `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` 356 | Value *ObjectID `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` 357 | } 358 | 359 | func (x *DictionaryElement) Reset() { 360 | *x = DictionaryElement{} 361 | if protoimpl.UnsafeEnabled { 362 | mi := &file_notestore_proto_msgTypes[5] 363 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 364 | ms.StoreMessageInfo(mi) 365 | } 366 | } 367 | 368 | func (x *DictionaryElement) String() string { 369 | return protoimpl.X.MessageStringOf(x) 370 | } 371 | 372 | func (*DictionaryElement) ProtoMessage() {} 373 | 374 | func (x *DictionaryElement) ProtoReflect() protoreflect.Message { 375 | mi := &file_notestore_proto_msgTypes[5] 376 | if protoimpl.UnsafeEnabled && x != nil { 377 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 378 | if ms.LoadMessageInfo() == nil { 379 | ms.StoreMessageInfo(mi) 380 | } 381 | return ms 382 | } 383 | return mi.MessageOf(x) 384 | } 385 | 386 | // Deprecated: Use DictionaryElement.ProtoReflect.Descriptor instead. 387 | func (*DictionaryElement) Descriptor() ([]byte, []int) { 388 | return file_notestore_proto_rawDescGZIP(), []int{5} 389 | } 390 | 391 | func (x *DictionaryElement) GetKey() *ObjectID { 392 | if x != nil { 393 | return x.Key 394 | } 395 | return nil 396 | } 397 | 398 | func (x *DictionaryElement) GetValue() *ObjectID { 399 | if x != nil { 400 | return x.Value 401 | } 402 | return nil 403 | } 404 | 405 | // A Dictionary holds many DictionaryElements 406 | type Dictionary struct { 407 | state protoimpl.MessageState 408 | sizeCache protoimpl.SizeCache 409 | unknownFields protoimpl.UnknownFields 410 | 411 | Element []*DictionaryElement `protobuf:"bytes,1,rep,name=element" json:"element,omitempty"` 412 | } 413 | 414 | func (x *Dictionary) Reset() { 415 | *x = Dictionary{} 416 | if protoimpl.UnsafeEnabled { 417 | mi := &file_notestore_proto_msgTypes[6] 418 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 419 | ms.StoreMessageInfo(mi) 420 | } 421 | } 422 | 423 | func (x *Dictionary) String() string { 424 | return protoimpl.X.MessageStringOf(x) 425 | } 426 | 427 | func (*Dictionary) ProtoMessage() {} 428 | 429 | func (x *Dictionary) ProtoReflect() protoreflect.Message { 430 | mi := &file_notestore_proto_msgTypes[6] 431 | if protoimpl.UnsafeEnabled && x != nil { 432 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 433 | if ms.LoadMessageInfo() == nil { 434 | ms.StoreMessageInfo(mi) 435 | } 436 | return ms 437 | } 438 | return mi.MessageOf(x) 439 | } 440 | 441 | // Deprecated: Use Dictionary.ProtoReflect.Descriptor instead. 442 | func (*Dictionary) Descriptor() ([]byte, []int) { 443 | return file_notestore_proto_rawDescGZIP(), []int{6} 444 | } 445 | 446 | func (x *Dictionary) GetElement() []*DictionaryElement { 447 | if x != nil { 448 | return x.Element 449 | } 450 | return nil 451 | } 452 | 453 | // ObjectIDs are used to identify objects within the protobuf, offsets in an arry, or 454 | // a simple String. 455 | type ObjectID struct { 456 | state protoimpl.MessageState 457 | sizeCache protoimpl.SizeCache 458 | unknownFields protoimpl.UnknownFields 459 | 460 | UnsignedIntegerValue *uint64 `protobuf:"varint,2,req,name=unsigned_integer_value,json=unsignedIntegerValue" json:"unsigned_integer_value,omitempty"` 461 | StringValue *string `protobuf:"bytes,4,req,name=string_value,json=stringValue" json:"string_value,omitempty"` 462 | ObjectIndex *int32 `protobuf:"varint,6,req,name=object_index,json=objectIndex" json:"object_index,omitempty"` 463 | } 464 | 465 | func (x *ObjectID) Reset() { 466 | *x = ObjectID{} 467 | if protoimpl.UnsafeEnabled { 468 | mi := &file_notestore_proto_msgTypes[7] 469 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 470 | ms.StoreMessageInfo(mi) 471 | } 472 | } 473 | 474 | func (x *ObjectID) String() string { 475 | return protoimpl.X.MessageStringOf(x) 476 | } 477 | 478 | func (*ObjectID) ProtoMessage() {} 479 | 480 | func (x *ObjectID) ProtoReflect() protoreflect.Message { 481 | mi := &file_notestore_proto_msgTypes[7] 482 | if protoimpl.UnsafeEnabled && x != nil { 483 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 484 | if ms.LoadMessageInfo() == nil { 485 | ms.StoreMessageInfo(mi) 486 | } 487 | return ms 488 | } 489 | return mi.MessageOf(x) 490 | } 491 | 492 | // Deprecated: Use ObjectID.ProtoReflect.Descriptor instead. 493 | func (*ObjectID) Descriptor() ([]byte, []int) { 494 | return file_notestore_proto_rawDescGZIP(), []int{7} 495 | } 496 | 497 | func (x *ObjectID) GetUnsignedIntegerValue() uint64 { 498 | if x != nil && x.UnsignedIntegerValue != nil { 499 | return *x.UnsignedIntegerValue 500 | } 501 | return 0 502 | } 503 | 504 | func (x *ObjectID) GetStringValue() string { 505 | if x != nil && x.StringValue != nil { 506 | return *x.StringValue 507 | } 508 | return "" 509 | } 510 | 511 | func (x *ObjectID) GetObjectIndex() int32 { 512 | if x != nil && x.ObjectIndex != nil { 513 | return *x.ObjectIndex 514 | } 515 | return 0 516 | } 517 | 518 | // Register Latest is used to identify the most recent version 519 | type RegisterLatest struct { 520 | state protoimpl.MessageState 521 | sizeCache protoimpl.SizeCache 522 | unknownFields protoimpl.UnknownFields 523 | 524 | Contents *ObjectID `protobuf:"bytes,2,req,name=contents" json:"contents,omitempty"` 525 | } 526 | 527 | func (x *RegisterLatest) Reset() { 528 | *x = RegisterLatest{} 529 | if protoimpl.UnsafeEnabled { 530 | mi := &file_notestore_proto_msgTypes[8] 531 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 532 | ms.StoreMessageInfo(mi) 533 | } 534 | } 535 | 536 | func (x *RegisterLatest) String() string { 537 | return protoimpl.X.MessageStringOf(x) 538 | } 539 | 540 | func (*RegisterLatest) ProtoMessage() {} 541 | 542 | func (x *RegisterLatest) ProtoReflect() protoreflect.Message { 543 | mi := &file_notestore_proto_msgTypes[8] 544 | if protoimpl.UnsafeEnabled && x != nil { 545 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 546 | if ms.LoadMessageInfo() == nil { 547 | ms.StoreMessageInfo(mi) 548 | } 549 | return ms 550 | } 551 | return mi.MessageOf(x) 552 | } 553 | 554 | // Deprecated: Use RegisterLatest.ProtoReflect.Descriptor instead. 555 | func (*RegisterLatest) Descriptor() ([]byte, []int) { 556 | return file_notestore_proto_rawDescGZIP(), []int{8} 557 | } 558 | 559 | func (x *RegisterLatest) GetContents() *ObjectID { 560 | if x != nil { 561 | return x.Contents 562 | } 563 | return nil 564 | } 565 | 566 | // MapEntries have a key that maps to an array of key items and a value that points to an object. 567 | type MapEntry struct { 568 | state protoimpl.MessageState 569 | sizeCache protoimpl.SizeCache 570 | unknownFields protoimpl.UnknownFields 571 | 572 | Key *int32 `protobuf:"varint,1,req,name=key" json:"key,omitempty"` 573 | Value *ObjectID `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` 574 | } 575 | 576 | func (x *MapEntry) Reset() { 577 | *x = MapEntry{} 578 | if protoimpl.UnsafeEnabled { 579 | mi := &file_notestore_proto_msgTypes[9] 580 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 581 | ms.StoreMessageInfo(mi) 582 | } 583 | } 584 | 585 | func (x *MapEntry) String() string { 586 | return protoimpl.X.MessageStringOf(x) 587 | } 588 | 589 | func (*MapEntry) ProtoMessage() {} 590 | 591 | func (x *MapEntry) ProtoReflect() protoreflect.Message { 592 | mi := &file_notestore_proto_msgTypes[9] 593 | if protoimpl.UnsafeEnabled && x != nil { 594 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 595 | if ms.LoadMessageInfo() == nil { 596 | ms.StoreMessageInfo(mi) 597 | } 598 | return ms 599 | } 600 | return mi.MessageOf(x) 601 | } 602 | 603 | // Deprecated: Use MapEntry.ProtoReflect.Descriptor instead. 604 | func (*MapEntry) Descriptor() ([]byte, []int) { 605 | return file_notestore_proto_rawDescGZIP(), []int{9} 606 | } 607 | 608 | func (x *MapEntry) GetKey() int32 { 609 | if x != nil && x.Key != nil { 610 | return *x.Key 611 | } 612 | return 0 613 | } 614 | 615 | func (x *MapEntry) GetValue() *ObjectID { 616 | if x != nil { 617 | return x.Value 618 | } 619 | return nil 620 | } 621 | 622 | // Represents a "run" of characters that need to be styled/displayed/etc 623 | type AttributeRun struct { 624 | state protoimpl.MessageState 625 | sizeCache protoimpl.SizeCache 626 | unknownFields protoimpl.UnknownFields 627 | 628 | Length *int32 `protobuf:"varint,1,req,name=length" json:"length,omitempty"` 629 | ParagraphStyle *ParagraphStyle `protobuf:"bytes,2,opt,name=paragraph_style,json=paragraphStyle" json:"paragraph_style,omitempty"` 630 | Font *Font `protobuf:"bytes,3,opt,name=font" json:"font,omitempty"` 631 | FontWeight *int32 `protobuf:"varint,5,opt,name=font_weight,json=fontWeight" json:"font_weight,omitempty"` 632 | Underlined *int32 `protobuf:"varint,6,opt,name=underlined" json:"underlined,omitempty"` 633 | Strikethrough *int32 `protobuf:"varint,7,opt,name=strikethrough" json:"strikethrough,omitempty"` 634 | Superscript *int32 `protobuf:"varint,8,opt,name=superscript" json:"superscript,omitempty"` //Sign indicates super/sub 635 | Link *string `protobuf:"bytes,9,opt,name=link" json:"link,omitempty"` 636 | Color *Color `protobuf:"bytes,10,opt,name=color" json:"color,omitempty"` 637 | AttachmentInfo *AttachmentInfo `protobuf:"bytes,12,opt,name=attachment_info,json=attachmentInfo" json:"attachment_info,omitempty"` 638 | } 639 | 640 | func (x *AttributeRun) Reset() { 641 | *x = AttributeRun{} 642 | if protoimpl.UnsafeEnabled { 643 | mi := &file_notestore_proto_msgTypes[10] 644 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 645 | ms.StoreMessageInfo(mi) 646 | } 647 | } 648 | 649 | func (x *AttributeRun) String() string { 650 | return protoimpl.X.MessageStringOf(x) 651 | } 652 | 653 | func (*AttributeRun) ProtoMessage() {} 654 | 655 | func (x *AttributeRun) ProtoReflect() protoreflect.Message { 656 | mi := &file_notestore_proto_msgTypes[10] 657 | if protoimpl.UnsafeEnabled && x != nil { 658 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 659 | if ms.LoadMessageInfo() == nil { 660 | ms.StoreMessageInfo(mi) 661 | } 662 | return ms 663 | } 664 | return mi.MessageOf(x) 665 | } 666 | 667 | // Deprecated: Use AttributeRun.ProtoReflect.Descriptor instead. 668 | func (*AttributeRun) Descriptor() ([]byte, []int) { 669 | return file_notestore_proto_rawDescGZIP(), []int{10} 670 | } 671 | 672 | func (x *AttributeRun) GetLength() int32 { 673 | if x != nil && x.Length != nil { 674 | return *x.Length 675 | } 676 | return 0 677 | } 678 | 679 | func (x *AttributeRun) GetParagraphStyle() *ParagraphStyle { 680 | if x != nil { 681 | return x.ParagraphStyle 682 | } 683 | return nil 684 | } 685 | 686 | func (x *AttributeRun) GetFont() *Font { 687 | if x != nil { 688 | return x.Font 689 | } 690 | return nil 691 | } 692 | 693 | func (x *AttributeRun) GetFontWeight() int32 { 694 | if x != nil && x.FontWeight != nil { 695 | return *x.FontWeight 696 | } 697 | return 0 698 | } 699 | 700 | func (x *AttributeRun) GetUnderlined() int32 { 701 | if x != nil && x.Underlined != nil { 702 | return *x.Underlined 703 | } 704 | return 0 705 | } 706 | 707 | func (x *AttributeRun) GetStrikethrough() int32 { 708 | if x != nil && x.Strikethrough != nil { 709 | return *x.Strikethrough 710 | } 711 | return 0 712 | } 713 | 714 | func (x *AttributeRun) GetSuperscript() int32 { 715 | if x != nil && x.Superscript != nil { 716 | return *x.Superscript 717 | } 718 | return 0 719 | } 720 | 721 | func (x *AttributeRun) GetLink() string { 722 | if x != nil && x.Link != nil { 723 | return *x.Link 724 | } 725 | return "" 726 | } 727 | 728 | func (x *AttributeRun) GetColor() *Color { 729 | if x != nil { 730 | return x.Color 731 | } 732 | return nil 733 | } 734 | 735 | func (x *AttributeRun) GetAttachmentInfo() *AttachmentInfo { 736 | if x != nil { 737 | return x.AttachmentInfo 738 | } 739 | return nil 740 | } 741 | 742 | // Overarching object in a ZNOTEDATA.ZDATA blob 743 | type NoteStoreProto struct { 744 | state protoimpl.MessageState 745 | sizeCache protoimpl.SizeCache 746 | unknownFields protoimpl.UnknownFields 747 | 748 | Document *Document `protobuf:"bytes,2,req,name=document" json:"document,omitempty"` 749 | } 750 | 751 | func (x *NoteStoreProto) Reset() { 752 | *x = NoteStoreProto{} 753 | if protoimpl.UnsafeEnabled { 754 | mi := &file_notestore_proto_msgTypes[11] 755 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 756 | ms.StoreMessageInfo(mi) 757 | } 758 | } 759 | 760 | func (x *NoteStoreProto) String() string { 761 | return protoimpl.X.MessageStringOf(x) 762 | } 763 | 764 | func (*NoteStoreProto) ProtoMessage() {} 765 | 766 | func (x *NoteStoreProto) ProtoReflect() protoreflect.Message { 767 | mi := &file_notestore_proto_msgTypes[11] 768 | if protoimpl.UnsafeEnabled && x != nil { 769 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 770 | if ms.LoadMessageInfo() == nil { 771 | ms.StoreMessageInfo(mi) 772 | } 773 | return ms 774 | } 775 | return mi.MessageOf(x) 776 | } 777 | 778 | // Deprecated: Use NoteStoreProto.ProtoReflect.Descriptor instead. 779 | func (*NoteStoreProto) Descriptor() ([]byte, []int) { 780 | return file_notestore_proto_rawDescGZIP(), []int{11} 781 | } 782 | 783 | func (x *NoteStoreProto) GetDocument() *Document { 784 | if x != nil { 785 | return x.Document 786 | } 787 | return nil 788 | } 789 | 790 | // A Document has a Note within it. 791 | type Document struct { 792 | state protoimpl.MessageState 793 | sizeCache protoimpl.SizeCache 794 | unknownFields protoimpl.UnknownFields 795 | 796 | Version *int32 `protobuf:"varint,2,req,name=version" json:"version,omitempty"` 797 | Note *Note `protobuf:"bytes,3,req,name=note" json:"note,omitempty"` 798 | } 799 | 800 | func (x *Document) Reset() { 801 | *x = Document{} 802 | if protoimpl.UnsafeEnabled { 803 | mi := &file_notestore_proto_msgTypes[12] 804 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 805 | ms.StoreMessageInfo(mi) 806 | } 807 | } 808 | 809 | func (x *Document) String() string { 810 | return protoimpl.X.MessageStringOf(x) 811 | } 812 | 813 | func (*Document) ProtoMessage() {} 814 | 815 | func (x *Document) ProtoReflect() protoreflect.Message { 816 | mi := &file_notestore_proto_msgTypes[12] 817 | if protoimpl.UnsafeEnabled && x != nil { 818 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 819 | if ms.LoadMessageInfo() == nil { 820 | ms.StoreMessageInfo(mi) 821 | } 822 | return ms 823 | } 824 | return mi.MessageOf(x) 825 | } 826 | 827 | // Deprecated: Use Document.ProtoReflect.Descriptor instead. 828 | func (*Document) Descriptor() ([]byte, []int) { 829 | return file_notestore_proto_rawDescGZIP(), []int{12} 830 | } 831 | 832 | func (x *Document) GetVersion() int32 { 833 | if x != nil && x.Version != nil { 834 | return *x.Version 835 | } 836 | return 0 837 | } 838 | 839 | func (x *Document) GetNote() *Note { 840 | if x != nil { 841 | return x.Note 842 | } 843 | return nil 844 | } 845 | 846 | // A Note has both text, and then a lot of formatting entries. 847 | // Other fields are present and not yet included in this proto. 848 | type Note struct { 849 | state protoimpl.MessageState 850 | sizeCache protoimpl.SizeCache 851 | unknownFields protoimpl.UnknownFields 852 | 853 | NoteText *string `protobuf:"bytes,2,req,name=note_text,json=noteText" json:"note_text,omitempty"` 854 | AttributeRun []*AttributeRun `protobuf:"bytes,5,rep,name=attribute_run,json=attributeRun" json:"attribute_run,omitempty"` 855 | } 856 | 857 | func (x *Note) Reset() { 858 | *x = Note{} 859 | if protoimpl.UnsafeEnabled { 860 | mi := &file_notestore_proto_msgTypes[13] 861 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 862 | ms.StoreMessageInfo(mi) 863 | } 864 | } 865 | 866 | func (x *Note) String() string { 867 | return protoimpl.X.MessageStringOf(x) 868 | } 869 | 870 | func (*Note) ProtoMessage() {} 871 | 872 | func (x *Note) ProtoReflect() protoreflect.Message { 873 | mi := &file_notestore_proto_msgTypes[13] 874 | if protoimpl.UnsafeEnabled && x != nil { 875 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 876 | if ms.LoadMessageInfo() == nil { 877 | ms.StoreMessageInfo(mi) 878 | } 879 | return ms 880 | } 881 | return mi.MessageOf(x) 882 | } 883 | 884 | // Deprecated: Use Note.ProtoReflect.Descriptor instead. 885 | func (*Note) Descriptor() ([]byte, []int) { 886 | return file_notestore_proto_rawDescGZIP(), []int{13} 887 | } 888 | 889 | func (x *Note) GetNoteText() string { 890 | if x != nil && x.NoteText != nil { 891 | return *x.NoteText 892 | } 893 | return "" 894 | } 895 | 896 | func (x *Note) GetAttributeRun() []*AttributeRun { 897 | if x != nil { 898 | return x.AttributeRun 899 | } 900 | return nil 901 | } 902 | 903 | // Represents the top level object in a ZMERGEABLEDATA cell 904 | type MergableDataProto struct { 905 | state protoimpl.MessageState 906 | sizeCache protoimpl.SizeCache 907 | unknownFields protoimpl.UnknownFields 908 | 909 | MergableDataObject *MergableDataObject `protobuf:"bytes,2,req,name=mergable_data_object,json=mergableDataObject" json:"mergable_data_object,omitempty"` 910 | } 911 | 912 | func (x *MergableDataProto) Reset() { 913 | *x = MergableDataProto{} 914 | if protoimpl.UnsafeEnabled { 915 | mi := &file_notestore_proto_msgTypes[14] 916 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 917 | ms.StoreMessageInfo(mi) 918 | } 919 | } 920 | 921 | func (x *MergableDataProto) String() string { 922 | return protoimpl.X.MessageStringOf(x) 923 | } 924 | 925 | func (*MergableDataProto) ProtoMessage() {} 926 | 927 | func (x *MergableDataProto) ProtoReflect() protoreflect.Message { 928 | mi := &file_notestore_proto_msgTypes[14] 929 | if protoimpl.UnsafeEnabled && x != nil { 930 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 931 | if ms.LoadMessageInfo() == nil { 932 | ms.StoreMessageInfo(mi) 933 | } 934 | return ms 935 | } 936 | return mi.MessageOf(x) 937 | } 938 | 939 | // Deprecated: Use MergableDataProto.ProtoReflect.Descriptor instead. 940 | func (*MergableDataProto) Descriptor() ([]byte, []int) { 941 | return file_notestore_proto_rawDescGZIP(), []int{14} 942 | } 943 | 944 | func (x *MergableDataProto) GetMergableDataObject() *MergableDataObject { 945 | if x != nil { 946 | return x.MergableDataObject 947 | } 948 | return nil 949 | } 950 | 951 | // Similar to Document for Notes, this is what holds the mergeable object 952 | type MergableDataObject struct { 953 | state protoimpl.MessageState 954 | sizeCache protoimpl.SizeCache 955 | unknownFields protoimpl.UnknownFields 956 | 957 | Version *int32 `protobuf:"varint,2,req,name=version" json:"version,omitempty"` // Asserted to be version in https://github.com/dunhamsteve/notesutils 958 | MergeableDataObjectData *MergeableDataObjectData `protobuf:"bytes,3,req,name=mergeable_data_object_data,json=mergeableDataObjectData" json:"mergeable_data_object_data,omitempty"` 959 | } 960 | 961 | func (x *MergableDataObject) Reset() { 962 | *x = MergableDataObject{} 963 | if protoimpl.UnsafeEnabled { 964 | mi := &file_notestore_proto_msgTypes[15] 965 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 966 | ms.StoreMessageInfo(mi) 967 | } 968 | } 969 | 970 | func (x *MergableDataObject) String() string { 971 | return protoimpl.X.MessageStringOf(x) 972 | } 973 | 974 | func (*MergableDataObject) ProtoMessage() {} 975 | 976 | func (x *MergableDataObject) ProtoReflect() protoreflect.Message { 977 | mi := &file_notestore_proto_msgTypes[15] 978 | if protoimpl.UnsafeEnabled && x != nil { 979 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 980 | if ms.LoadMessageInfo() == nil { 981 | ms.StoreMessageInfo(mi) 982 | } 983 | return ms 984 | } 985 | return mi.MessageOf(x) 986 | } 987 | 988 | // Deprecated: Use MergableDataObject.ProtoReflect.Descriptor instead. 989 | func (*MergableDataObject) Descriptor() ([]byte, []int) { 990 | return file_notestore_proto_rawDescGZIP(), []int{15} 991 | } 992 | 993 | func (x *MergableDataObject) GetVersion() int32 { 994 | if x != nil && x.Version != nil { 995 | return *x.Version 996 | } 997 | return 0 998 | } 999 | 1000 | func (x *MergableDataObject) GetMergeableDataObjectData() *MergeableDataObjectData { 1001 | if x != nil { 1002 | return x.MergeableDataObjectData 1003 | } 1004 | return nil 1005 | } 1006 | 1007 | // This is the mergeable data object itself and has a lot of entries that are the parts of it 1008 | // along with arrays of key, type, and UUID items, depending on type. 1009 | type MergeableDataObjectData struct { 1010 | state protoimpl.MessageState 1011 | sizeCache protoimpl.SizeCache 1012 | unknownFields protoimpl.UnknownFields 1013 | 1014 | MergeableDataObjectEntry []*MergeableDataObjectEntry `protobuf:"bytes,3,rep,name=mergeable_data_object_entry,json=mergeableDataObjectEntry" json:"mergeable_data_object_entry,omitempty"` 1015 | MergeableDataObjectKeyItem []string `protobuf:"bytes,4,rep,name=mergeable_data_object_key_item,json=mergeableDataObjectKeyItem" json:"mergeable_data_object_key_item,omitempty"` 1016 | MergeableDataObjectTypeItem []string `protobuf:"bytes,5,rep,name=mergeable_data_object_type_item,json=mergeableDataObjectTypeItem" json:"mergeable_data_object_type_item,omitempty"` 1017 | MergeableDataObjectUuidItem [][]byte `protobuf:"bytes,6,rep,name=mergeable_data_object_uuid_item,json=mergeableDataObjectUuidItem" json:"mergeable_data_object_uuid_item,omitempty"` 1018 | } 1019 | 1020 | func (x *MergeableDataObjectData) Reset() { 1021 | *x = MergeableDataObjectData{} 1022 | if protoimpl.UnsafeEnabled { 1023 | mi := &file_notestore_proto_msgTypes[16] 1024 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1025 | ms.StoreMessageInfo(mi) 1026 | } 1027 | } 1028 | 1029 | func (x *MergeableDataObjectData) String() string { 1030 | return protoimpl.X.MessageStringOf(x) 1031 | } 1032 | 1033 | func (*MergeableDataObjectData) ProtoMessage() {} 1034 | 1035 | func (x *MergeableDataObjectData) ProtoReflect() protoreflect.Message { 1036 | mi := &file_notestore_proto_msgTypes[16] 1037 | if protoimpl.UnsafeEnabled && x != nil { 1038 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1039 | if ms.LoadMessageInfo() == nil { 1040 | ms.StoreMessageInfo(mi) 1041 | } 1042 | return ms 1043 | } 1044 | return mi.MessageOf(x) 1045 | } 1046 | 1047 | // Deprecated: Use MergeableDataObjectData.ProtoReflect.Descriptor instead. 1048 | func (*MergeableDataObjectData) Descriptor() ([]byte, []int) { 1049 | return file_notestore_proto_rawDescGZIP(), []int{16} 1050 | } 1051 | 1052 | func (x *MergeableDataObjectData) GetMergeableDataObjectEntry() []*MergeableDataObjectEntry { 1053 | if x != nil { 1054 | return x.MergeableDataObjectEntry 1055 | } 1056 | return nil 1057 | } 1058 | 1059 | func (x *MergeableDataObjectData) GetMergeableDataObjectKeyItem() []string { 1060 | if x != nil { 1061 | return x.MergeableDataObjectKeyItem 1062 | } 1063 | return nil 1064 | } 1065 | 1066 | func (x *MergeableDataObjectData) GetMergeableDataObjectTypeItem() []string { 1067 | if x != nil { 1068 | return x.MergeableDataObjectTypeItem 1069 | } 1070 | return nil 1071 | } 1072 | 1073 | func (x *MergeableDataObjectData) GetMergeableDataObjectUuidItem() [][]byte { 1074 | if x != nil { 1075 | return x.MergeableDataObjectUuidItem 1076 | } 1077 | return nil 1078 | } 1079 | 1080 | // Each entry is part of the pbject. For example, one entry might be identifying which 1081 | // UUIDs are rows, and another might hold the text of a cell. 1082 | type MergeableDataObjectEntry struct { 1083 | state protoimpl.MessageState 1084 | sizeCache protoimpl.SizeCache 1085 | unknownFields protoimpl.UnknownFields 1086 | 1087 | RegisterLatest *RegisterLatest `protobuf:"bytes,1,req,name=register_latest,json=registerLatest" json:"register_latest,omitempty"` 1088 | Dictionary *Dictionary `protobuf:"bytes,6,opt,name=dictionary" json:"dictionary,omitempty"` 1089 | Note *Note `protobuf:"bytes,10,opt,name=note" json:"note,omitempty"` 1090 | CustomMap *MergeableDataObjectMap `protobuf:"bytes,13,opt,name=custom_map,json=customMap" json:"custom_map,omitempty"` 1091 | OrderedSet *OrderedSet `protobuf:"bytes,16,opt,name=ordered_set,json=orderedSet" json:"ordered_set,omitempty"` 1092 | } 1093 | 1094 | func (x *MergeableDataObjectEntry) Reset() { 1095 | *x = MergeableDataObjectEntry{} 1096 | if protoimpl.UnsafeEnabled { 1097 | mi := &file_notestore_proto_msgTypes[17] 1098 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1099 | ms.StoreMessageInfo(mi) 1100 | } 1101 | } 1102 | 1103 | func (x *MergeableDataObjectEntry) String() string { 1104 | return protoimpl.X.MessageStringOf(x) 1105 | } 1106 | 1107 | func (*MergeableDataObjectEntry) ProtoMessage() {} 1108 | 1109 | func (x *MergeableDataObjectEntry) ProtoReflect() protoreflect.Message { 1110 | mi := &file_notestore_proto_msgTypes[17] 1111 | if protoimpl.UnsafeEnabled && x != nil { 1112 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1113 | if ms.LoadMessageInfo() == nil { 1114 | ms.StoreMessageInfo(mi) 1115 | } 1116 | return ms 1117 | } 1118 | return mi.MessageOf(x) 1119 | } 1120 | 1121 | // Deprecated: Use MergeableDataObjectEntry.ProtoReflect.Descriptor instead. 1122 | func (*MergeableDataObjectEntry) Descriptor() ([]byte, []int) { 1123 | return file_notestore_proto_rawDescGZIP(), []int{17} 1124 | } 1125 | 1126 | func (x *MergeableDataObjectEntry) GetRegisterLatest() *RegisterLatest { 1127 | if x != nil { 1128 | return x.RegisterLatest 1129 | } 1130 | return nil 1131 | } 1132 | 1133 | func (x *MergeableDataObjectEntry) GetDictionary() *Dictionary { 1134 | if x != nil { 1135 | return x.Dictionary 1136 | } 1137 | return nil 1138 | } 1139 | 1140 | func (x *MergeableDataObjectEntry) GetNote() *Note { 1141 | if x != nil { 1142 | return x.Note 1143 | } 1144 | return nil 1145 | } 1146 | 1147 | func (x *MergeableDataObjectEntry) GetCustomMap() *MergeableDataObjectMap { 1148 | if x != nil { 1149 | return x.CustomMap 1150 | } 1151 | return nil 1152 | } 1153 | 1154 | func (x *MergeableDataObjectEntry) GetOrderedSet() *OrderedSet { 1155 | if x != nil { 1156 | return x.OrderedSet 1157 | } 1158 | return nil 1159 | } 1160 | 1161 | // The Object Map uses its type to identify what you are looking at and 1162 | // then a map entry to do something with that value. 1163 | type MergeableDataObjectMap struct { 1164 | state protoimpl.MessageState 1165 | sizeCache protoimpl.SizeCache 1166 | unknownFields protoimpl.UnknownFields 1167 | 1168 | Type *int32 `protobuf:"varint,1,req,name=type" json:"type,omitempty"` 1169 | MapEntry []*MapEntry `protobuf:"bytes,3,rep,name=map_entry,json=mapEntry" json:"map_entry,omitempty"` 1170 | } 1171 | 1172 | func (x *MergeableDataObjectMap) Reset() { 1173 | *x = MergeableDataObjectMap{} 1174 | if protoimpl.UnsafeEnabled { 1175 | mi := &file_notestore_proto_msgTypes[18] 1176 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1177 | ms.StoreMessageInfo(mi) 1178 | } 1179 | } 1180 | 1181 | func (x *MergeableDataObjectMap) String() string { 1182 | return protoimpl.X.MessageStringOf(x) 1183 | } 1184 | 1185 | func (*MergeableDataObjectMap) ProtoMessage() {} 1186 | 1187 | func (x *MergeableDataObjectMap) ProtoReflect() protoreflect.Message { 1188 | mi := &file_notestore_proto_msgTypes[18] 1189 | if protoimpl.UnsafeEnabled && x != nil { 1190 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1191 | if ms.LoadMessageInfo() == nil { 1192 | ms.StoreMessageInfo(mi) 1193 | } 1194 | return ms 1195 | } 1196 | return mi.MessageOf(x) 1197 | } 1198 | 1199 | // Deprecated: Use MergeableDataObjectMap.ProtoReflect.Descriptor instead. 1200 | func (*MergeableDataObjectMap) Descriptor() ([]byte, []int) { 1201 | return file_notestore_proto_rawDescGZIP(), []int{18} 1202 | } 1203 | 1204 | func (x *MergeableDataObjectMap) GetType() int32 { 1205 | if x != nil && x.Type != nil { 1206 | return *x.Type 1207 | } 1208 | return 0 1209 | } 1210 | 1211 | func (x *MergeableDataObjectMap) GetMapEntry() []*MapEntry { 1212 | if x != nil { 1213 | return x.MapEntry 1214 | } 1215 | return nil 1216 | } 1217 | 1218 | // An ordered set is used to hold structural information for embedded tables 1219 | type OrderedSet struct { 1220 | state protoimpl.MessageState 1221 | sizeCache protoimpl.SizeCache 1222 | unknownFields protoimpl.UnknownFields 1223 | 1224 | Ordering *OrderedSetOrdering `protobuf:"bytes,1,req,name=ordering" json:"ordering,omitempty"` 1225 | Elements *Dictionary `protobuf:"bytes,2,req,name=elements" json:"elements,omitempty"` 1226 | } 1227 | 1228 | func (x *OrderedSet) Reset() { 1229 | *x = OrderedSet{} 1230 | if protoimpl.UnsafeEnabled { 1231 | mi := &file_notestore_proto_msgTypes[19] 1232 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1233 | ms.StoreMessageInfo(mi) 1234 | } 1235 | } 1236 | 1237 | func (x *OrderedSet) String() string { 1238 | return protoimpl.X.MessageStringOf(x) 1239 | } 1240 | 1241 | func (*OrderedSet) ProtoMessage() {} 1242 | 1243 | func (x *OrderedSet) ProtoReflect() protoreflect.Message { 1244 | mi := &file_notestore_proto_msgTypes[19] 1245 | if protoimpl.UnsafeEnabled && x != nil { 1246 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1247 | if ms.LoadMessageInfo() == nil { 1248 | ms.StoreMessageInfo(mi) 1249 | } 1250 | return ms 1251 | } 1252 | return mi.MessageOf(x) 1253 | } 1254 | 1255 | // Deprecated: Use OrderedSet.ProtoReflect.Descriptor instead. 1256 | func (*OrderedSet) Descriptor() ([]byte, []int) { 1257 | return file_notestore_proto_rawDescGZIP(), []int{19} 1258 | } 1259 | 1260 | func (x *OrderedSet) GetOrdering() *OrderedSetOrdering { 1261 | if x != nil { 1262 | return x.Ordering 1263 | } 1264 | return nil 1265 | } 1266 | 1267 | func (x *OrderedSet) GetElements() *Dictionary { 1268 | if x != nil { 1269 | return x.Elements 1270 | } 1271 | return nil 1272 | } 1273 | 1274 | // The ordered set ordering identifies rows and columns in embedded tables, with an array 1275 | // of the objects and contents that map lookup values to originals. 1276 | type OrderedSetOrdering struct { 1277 | state protoimpl.MessageState 1278 | sizeCache protoimpl.SizeCache 1279 | unknownFields protoimpl.UnknownFields 1280 | 1281 | Array *OrderedSetOrderingArray `protobuf:"bytes,1,req,name=array" json:"array,omitempty"` 1282 | Contents *Dictionary `protobuf:"bytes,2,req,name=contents" json:"contents,omitempty"` 1283 | } 1284 | 1285 | func (x *OrderedSetOrdering) Reset() { 1286 | *x = OrderedSetOrdering{} 1287 | if protoimpl.UnsafeEnabled { 1288 | mi := &file_notestore_proto_msgTypes[20] 1289 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1290 | ms.StoreMessageInfo(mi) 1291 | } 1292 | } 1293 | 1294 | func (x *OrderedSetOrdering) String() string { 1295 | return protoimpl.X.MessageStringOf(x) 1296 | } 1297 | 1298 | func (*OrderedSetOrdering) ProtoMessage() {} 1299 | 1300 | func (x *OrderedSetOrdering) ProtoReflect() protoreflect.Message { 1301 | mi := &file_notestore_proto_msgTypes[20] 1302 | if protoimpl.UnsafeEnabled && x != nil { 1303 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1304 | if ms.LoadMessageInfo() == nil { 1305 | ms.StoreMessageInfo(mi) 1306 | } 1307 | return ms 1308 | } 1309 | return mi.MessageOf(x) 1310 | } 1311 | 1312 | // Deprecated: Use OrderedSetOrdering.ProtoReflect.Descriptor instead. 1313 | func (*OrderedSetOrdering) Descriptor() ([]byte, []int) { 1314 | return file_notestore_proto_rawDescGZIP(), []int{20} 1315 | } 1316 | 1317 | func (x *OrderedSetOrdering) GetArray() *OrderedSetOrderingArray { 1318 | if x != nil { 1319 | return x.Array 1320 | } 1321 | return nil 1322 | } 1323 | 1324 | func (x *OrderedSetOrdering) GetContents() *Dictionary { 1325 | if x != nil { 1326 | return x.Contents 1327 | } 1328 | return nil 1329 | } 1330 | 1331 | // This array holds both the text to replace and the array of UUIDs to tell what 1332 | // embedded rows and columns are. 1333 | type OrderedSetOrderingArray struct { 1334 | state protoimpl.MessageState 1335 | sizeCache protoimpl.SizeCache 1336 | unknownFields protoimpl.UnknownFields 1337 | 1338 | Contents *Note `protobuf:"bytes,1,req,name=contents" json:"contents,omitempty"` 1339 | Attachment []*OrderedSetOrderingArrayAttachment `protobuf:"bytes,2,rep,name=attachment" json:"attachment,omitempty"` 1340 | } 1341 | 1342 | func (x *OrderedSetOrderingArray) Reset() { 1343 | *x = OrderedSetOrderingArray{} 1344 | if protoimpl.UnsafeEnabled { 1345 | mi := &file_notestore_proto_msgTypes[21] 1346 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1347 | ms.StoreMessageInfo(mi) 1348 | } 1349 | } 1350 | 1351 | func (x *OrderedSetOrderingArray) String() string { 1352 | return protoimpl.X.MessageStringOf(x) 1353 | } 1354 | 1355 | func (*OrderedSetOrderingArray) ProtoMessage() {} 1356 | 1357 | func (x *OrderedSetOrderingArray) ProtoReflect() protoreflect.Message { 1358 | mi := &file_notestore_proto_msgTypes[21] 1359 | if protoimpl.UnsafeEnabled && x != nil { 1360 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1361 | if ms.LoadMessageInfo() == nil { 1362 | ms.StoreMessageInfo(mi) 1363 | } 1364 | return ms 1365 | } 1366 | return mi.MessageOf(x) 1367 | } 1368 | 1369 | // Deprecated: Use OrderedSetOrderingArray.ProtoReflect.Descriptor instead. 1370 | func (*OrderedSetOrderingArray) Descriptor() ([]byte, []int) { 1371 | return file_notestore_proto_rawDescGZIP(), []int{21} 1372 | } 1373 | 1374 | func (x *OrderedSetOrderingArray) GetContents() *Note { 1375 | if x != nil { 1376 | return x.Contents 1377 | } 1378 | return nil 1379 | } 1380 | 1381 | func (x *OrderedSetOrderingArray) GetAttachment() []*OrderedSetOrderingArrayAttachment { 1382 | if x != nil { 1383 | return x.Attachment 1384 | } 1385 | return nil 1386 | } 1387 | 1388 | // This array identifies the UUIDs that are embedded table rows or columns 1389 | type OrderedSetOrderingArrayAttachment struct { 1390 | state protoimpl.MessageState 1391 | sizeCache protoimpl.SizeCache 1392 | unknownFields protoimpl.UnknownFields 1393 | 1394 | Index *int32 `protobuf:"varint,1,req,name=index" json:"index,omitempty"` 1395 | Uuid []byte `protobuf:"bytes,2,req,name=uuid" json:"uuid,omitempty"` 1396 | } 1397 | 1398 | func (x *OrderedSetOrderingArrayAttachment) Reset() { 1399 | *x = OrderedSetOrderingArrayAttachment{} 1400 | if protoimpl.UnsafeEnabled { 1401 | mi := &file_notestore_proto_msgTypes[22] 1402 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1403 | ms.StoreMessageInfo(mi) 1404 | } 1405 | } 1406 | 1407 | func (x *OrderedSetOrderingArrayAttachment) String() string { 1408 | return protoimpl.X.MessageStringOf(x) 1409 | } 1410 | 1411 | func (*OrderedSetOrderingArrayAttachment) ProtoMessage() {} 1412 | 1413 | func (x *OrderedSetOrderingArrayAttachment) ProtoReflect() protoreflect.Message { 1414 | mi := &file_notestore_proto_msgTypes[22] 1415 | if protoimpl.UnsafeEnabled && x != nil { 1416 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1417 | if ms.LoadMessageInfo() == nil { 1418 | ms.StoreMessageInfo(mi) 1419 | } 1420 | return ms 1421 | } 1422 | return mi.MessageOf(x) 1423 | } 1424 | 1425 | // Deprecated: Use OrderedSetOrderingArrayAttachment.ProtoReflect.Descriptor instead. 1426 | func (*OrderedSetOrderingArrayAttachment) Descriptor() ([]byte, []int) { 1427 | return file_notestore_proto_rawDescGZIP(), []int{22} 1428 | } 1429 | 1430 | func (x *OrderedSetOrderingArrayAttachment) GetIndex() int32 { 1431 | if x != nil && x.Index != nil { 1432 | return *x.Index 1433 | } 1434 | return 0 1435 | } 1436 | 1437 | func (x *OrderedSetOrderingArrayAttachment) GetUuid() []byte { 1438 | if x != nil { 1439 | return x.Uuid 1440 | } 1441 | return nil 1442 | } 1443 | 1444 | var File_notestore_proto protoreflect.FileDescriptor 1445 | 1446 | var file_notestore_proto_rawDesc = []byte{ 1447 | 0x0a, 0x0f, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 1448 | 0x6f, 0x22, 0x59, 0x0a, 0x05, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 1449 | 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x02, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 1450 | 0x67, 0x72, 0x65, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x02, 0x52, 0x05, 0x67, 0x72, 0x65, 1451 | 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x02, 0x28, 0x02, 1452 | 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x18, 1453 | 0x04, 0x20, 0x02, 0x28, 0x02, 0x52, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x22, 0x60, 0x0a, 0x0e, 1454 | 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 1455 | 0x0a, 0x15, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x65, 1456 | 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 1457 | 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 1458 | 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x74, 0x69, 0x18, 1459 | 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x74, 0x69, 0x22, 0x61, 1460 | 0x0a, 0x04, 0x46, 0x6f, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x5f, 0x6e, 1461 | 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x6f, 0x6e, 0x74, 0x4e, 1462 | 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 1463 | 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 1464 | 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x6f, 0x6e, 0x74, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x73, 1465 | 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x48, 0x69, 0x6e, 0x74, 1466 | 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 1467 | 0x74, 0x79, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0a, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x5f, 0x74, 0x79, 1468 | 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x02, 0x2d, 0x31, 0x52, 0x09, 0x73, 0x74, 1469 | 0x79, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x69, 0x67, 0x6e, 1470 | 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x6c, 0x69, 0x67, 1471 | 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 1472 | 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 1473 | 0x64, 0x65, 0x6e, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x63, 0x68, 1474 | 0x65, 0x63, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 1475 | 0x43, 0x68, 0x65, 0x63, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 1476 | 0x6c, 0x69, 0x73, 0x74, 0x22, 0x33, 0x0a, 0x09, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x6c, 0x69, 0x73, 1477 | 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0c, 0x52, 1478 | 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 1479 | 0x02, 0x28, 0x05, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x22, 0x51, 0x0a, 0x11, 0x44, 0x69, 0x63, 1480 | 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1b, 1481 | 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x4f, 0x62, 1482 | 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 1483 | 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x4f, 0x62, 0x6a, 1484 | 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 1485 | 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x07, 0x65, 0x6c, 1486 | 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x44, 0x69, 1487 | 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 1488 | 0x07, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x08, 0x4f, 0x62, 0x6a, 1489 | 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x34, 0x0a, 0x16, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 1490 | 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 1491 | 0x02, 0x20, 0x02, 0x28, 0x04, 0x52, 0x14, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x49, 1492 | 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 1493 | 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x02, 0x28, 1494 | 0x09, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 1495 | 0x0a, 0x0c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 1496 | 0x20, 0x02, 0x28, 0x05, 0x52, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x64, 0x65, 1497 | 0x78, 0x22, 0x37, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4c, 0x61, 0x74, 1498 | 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 1499 | 0x02, 0x20, 0x02, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 1500 | 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x3d, 0x0a, 0x08, 0x4d, 0x61, 1501 | 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 1502 | 0x02, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 1503 | 0x65, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 1504 | 0x49, 0x44, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf0, 0x02, 0x0a, 0x0c, 0x41, 0x74, 1505 | 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x75, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 1506 | 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x02, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 1507 | 0x74, 0x68, 0x12, 0x38, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5f, 1508 | 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x50, 0x61, 1509 | 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0e, 0x70, 0x61, 1510 | 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x04, 1511 | 0x66, 0x6f, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x46, 0x6f, 0x6e, 1512 | 0x74, 0x52, 0x04, 0x66, 0x6f, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6f, 0x6e, 0x74, 0x5f, 1513 | 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x66, 0x6f, 1514 | 0x6e, 0x74, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x6e, 0x64, 0x65, 1515 | 0x72, 0x6c, 0x69, 0x6e, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x75, 0x6e, 1516 | 0x64, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 1517 | 0x6b, 0x65, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 1518 | 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x12, 0x20, 1519 | 0x0a, 0x0b, 0x73, 0x75, 0x70, 0x65, 0x72, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x08, 0x20, 1520 | 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x75, 0x70, 0x65, 0x72, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 1521 | 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 1522 | 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x1c, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0a, 0x20, 1523 | 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x05, 0x63, 0x6f, 0x6c, 1524 | 0x6f, 0x72, 0x12, 0x38, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 1525 | 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x41, 0x74, 1526 | 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x61, 0x74, 1527 | 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x37, 0x0a, 0x0e, 1528 | 0x4e, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 1529 | 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0b, 1530 | 0x32, 0x09, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 1531 | 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x3f, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 1532 | 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x02, 1533 | 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x04, 0x6e, 1534 | 0x6f, 0x74, 0x65, 0x18, 0x03, 0x20, 0x02, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 1535 | 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x22, 0x57, 0x0a, 0x04, 0x4e, 0x6f, 0x74, 0x65, 0x12, 0x1b, 1536 | 0x0a, 0x09, 0x6e, 0x6f, 0x74, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x02, 0x28, 1537 | 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x74, 0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x32, 0x0a, 0x0d, 0x61, 1538 | 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x05, 0x20, 0x03, 1539 | 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x75, 1540 | 0x6e, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x75, 0x6e, 0x22, 1541 | 0x5a, 0x0a, 0x11, 0x4d, 0x65, 0x72, 0x67, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x50, 1542 | 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x45, 0x0a, 0x14, 0x6d, 0x65, 0x72, 0x67, 0x61, 0x62, 0x6c, 0x65, 1543 | 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x02, 1544 | 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 1545 | 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x12, 0x6d, 0x65, 0x72, 0x67, 0x61, 0x62, 0x6c, 1546 | 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x85, 0x01, 0x0a, 0x12, 1547 | 0x4d, 0x65, 0x72, 0x67, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 1548 | 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 1549 | 0x02, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x55, 0x0a, 0x1a, 1550 | 0x6d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 1551 | 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x02, 0x28, 0x0b, 1552 | 0x32, 0x18, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 1553 | 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x17, 0x6d, 0x65, 0x72, 0x67, 1554 | 0x65, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 1555 | 0x61, 0x74, 0x61, 0x22, 0xc3, 0x02, 0x0a, 0x17, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 1556 | 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 1557 | 0x58, 0x0a, 0x1b, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 1558 | 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x03, 1559 | 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 1560 | 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 1561 | 0x18, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 1562 | 0x6a, 0x65, 0x63, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x1e, 0x6d, 0x65, 0x72, 1563 | 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 1564 | 0x63, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x03, 0x28, 1565 | 0x09, 0x52, 0x1a, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 1566 | 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4b, 0x65, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x44, 0x0a, 1567 | 0x1f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 1568 | 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 1569 | 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 1570 | 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x49, 1571 | 0x74, 0x65, 0x6d, 0x12, 0x44, 0x0a, 0x1f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 1572 | 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x75, 0x69, 1573 | 0x64, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x1b, 0x6d, 0x65, 1574 | 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 1575 | 0x74, 0x55, 0x75, 0x69, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x82, 0x02, 0x0a, 0x18, 0x4d, 0x65, 1576 | 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 0x63, 1577 | 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x38, 0x0a, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 1578 | 0x65, 0x72, 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0b, 0x32, 1579 | 0x0f, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 1580 | 0x52, 0x0e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 1581 | 0x12, 0x2b, 0x0a, 0x0a, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x06, 1582 | 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 1583 | 0x79, 0x52, 0x0a, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x19, 0x0a, 1584 | 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x4e, 0x6f, 1585 | 0x74, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 1586 | 0x6f, 0x6d, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x4d, 1587 | 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x62, 0x6a, 0x65, 1588 | 0x63, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x09, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4d, 0x61, 0x70, 1589 | 0x12, 0x2c, 0x0a, 0x0b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x18, 1590 | 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 1591 | 0x65, 0x74, 0x52, 0x0a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 0x65, 0x74, 0x22, 0x54, 1592 | 0x0a, 0x16, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4f, 1593 | 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 1594 | 0x18, 0x01, 0x20, 0x02, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x09, 1595 | 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 1596 | 0x09, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x45, 1597 | 0x6e, 0x74, 0x72, 0x79, 0x22, 0x66, 0x0a, 0x0a, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 1598 | 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 1599 | 0x20, 0x02, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 0x65, 1600 | 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 1601 | 0x69, 0x6e, 0x67, 0x12, 0x27, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 1602 | 0x02, 0x20, 0x02, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 1603 | 0x72, 0x79, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x6d, 0x0a, 0x12, 1604 | 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x69, 1605 | 0x6e, 0x67, 0x12, 0x2e, 0x0a, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x01, 0x20, 0x02, 0x28, 1606 | 0x0b, 0x32, 0x18, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 0x65, 0x74, 0x4f, 0x72, 1607 | 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x05, 0x61, 0x72, 0x72, 1608 | 0x61, 0x79, 0x12, 0x27, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 1609 | 0x20, 0x02, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 1610 | 0x79, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x17, 1611 | 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x69, 1612 | 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x21, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 1613 | 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 1614 | 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x61, 0x74, 1615 | 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 1616 | 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 1617 | 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 1618 | 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x4d, 1619 | 0x0a, 0x21, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 1620 | 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 1621 | 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x02, 1622 | 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 1623 | 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 1624 | } 1625 | 1626 | var ( 1627 | file_notestore_proto_rawDescOnce sync.Once 1628 | file_notestore_proto_rawDescData = file_notestore_proto_rawDesc 1629 | ) 1630 | 1631 | func file_notestore_proto_rawDescGZIP() []byte { 1632 | file_notestore_proto_rawDescOnce.Do(func() { 1633 | file_notestore_proto_rawDescData = protoimpl.X.CompressGZIP(file_notestore_proto_rawDescData) 1634 | }) 1635 | return file_notestore_proto_rawDescData 1636 | } 1637 | 1638 | var file_notestore_proto_msgTypes = make([]protoimpl.MessageInfo, 23) 1639 | var file_notestore_proto_goTypes = []interface{}{ 1640 | (*Color)(nil), // 0: Color 1641 | (*AttachmentInfo)(nil), // 1: AttachmentInfo 1642 | (*Font)(nil), // 2: Font 1643 | (*ParagraphStyle)(nil), // 3: ParagraphStyle 1644 | (*Checklist)(nil), // 4: Checklist 1645 | (*DictionaryElement)(nil), // 5: DictionaryElement 1646 | (*Dictionary)(nil), // 6: Dictionary 1647 | (*ObjectID)(nil), // 7: ObjectID 1648 | (*RegisterLatest)(nil), // 8: RegisterLatest 1649 | (*MapEntry)(nil), // 9: MapEntry 1650 | (*AttributeRun)(nil), // 10: AttributeRun 1651 | (*NoteStoreProto)(nil), // 11: NoteStoreProto 1652 | (*Document)(nil), // 12: Document 1653 | (*Note)(nil), // 13: Note 1654 | (*MergableDataProto)(nil), // 14: MergableDataProto 1655 | (*MergableDataObject)(nil), // 15: MergableDataObject 1656 | (*MergeableDataObjectData)(nil), // 16: MergeableDataObjectData 1657 | (*MergeableDataObjectEntry)(nil), // 17: MergeableDataObjectEntry 1658 | (*MergeableDataObjectMap)(nil), // 18: MergeableDataObjectMap 1659 | (*OrderedSet)(nil), // 19: OrderedSet 1660 | (*OrderedSetOrdering)(nil), // 20: OrderedSetOrdering 1661 | (*OrderedSetOrderingArray)(nil), // 21: OrderedSetOrderingArray 1662 | (*OrderedSetOrderingArrayAttachment)(nil), // 22: OrderedSetOrderingArrayAttachment 1663 | } 1664 | var file_notestore_proto_depIdxs = []int32{ 1665 | 4, // 0: ParagraphStyle.checklist:type_name -> Checklist 1666 | 7, // 1: DictionaryElement.key:type_name -> ObjectID 1667 | 7, // 2: DictionaryElement.value:type_name -> ObjectID 1668 | 5, // 3: Dictionary.element:type_name -> DictionaryElement 1669 | 7, // 4: RegisterLatest.contents:type_name -> ObjectID 1670 | 7, // 5: MapEntry.value:type_name -> ObjectID 1671 | 3, // 6: AttributeRun.paragraph_style:type_name -> ParagraphStyle 1672 | 2, // 7: AttributeRun.font:type_name -> Font 1673 | 0, // 8: AttributeRun.color:type_name -> Color 1674 | 1, // 9: AttributeRun.attachment_info:type_name -> AttachmentInfo 1675 | 12, // 10: NoteStoreProto.document:type_name -> Document 1676 | 13, // 11: Document.note:type_name -> Note 1677 | 10, // 12: Note.attribute_run:type_name -> AttributeRun 1678 | 15, // 13: MergableDataProto.mergable_data_object:type_name -> MergableDataObject 1679 | 16, // 14: MergableDataObject.mergeable_data_object_data:type_name -> MergeableDataObjectData 1680 | 17, // 15: MergeableDataObjectData.mergeable_data_object_entry:type_name -> MergeableDataObjectEntry 1681 | 8, // 16: MergeableDataObjectEntry.register_latest:type_name -> RegisterLatest 1682 | 6, // 17: MergeableDataObjectEntry.dictionary:type_name -> Dictionary 1683 | 13, // 18: MergeableDataObjectEntry.note:type_name -> Note 1684 | 18, // 19: MergeableDataObjectEntry.custom_map:type_name -> MergeableDataObjectMap 1685 | 19, // 20: MergeableDataObjectEntry.ordered_set:type_name -> OrderedSet 1686 | 9, // 21: MergeableDataObjectMap.map_entry:type_name -> MapEntry 1687 | 20, // 22: OrderedSet.ordering:type_name -> OrderedSetOrdering 1688 | 6, // 23: OrderedSet.elements:type_name -> Dictionary 1689 | 21, // 24: OrderedSetOrdering.array:type_name -> OrderedSetOrderingArray 1690 | 6, // 25: OrderedSetOrdering.contents:type_name -> Dictionary 1691 | 13, // 26: OrderedSetOrderingArray.contents:type_name -> Note 1692 | 22, // 27: OrderedSetOrderingArray.attachment:type_name -> OrderedSetOrderingArrayAttachment 1693 | 28, // [28:28] is the sub-list for method output_type 1694 | 28, // [28:28] is the sub-list for method input_type 1695 | 28, // [28:28] is the sub-list for extension type_name 1696 | 28, // [28:28] is the sub-list for extension extendee 1697 | 0, // [0:28] is the sub-list for field type_name 1698 | } 1699 | 1700 | func init() { file_notestore_proto_init() } 1701 | func file_notestore_proto_init() { 1702 | if File_notestore_proto != nil { 1703 | return 1704 | } 1705 | if !protoimpl.UnsafeEnabled { 1706 | file_notestore_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 1707 | switch v := v.(*Color); i { 1708 | case 0: 1709 | return &v.state 1710 | case 1: 1711 | return &v.sizeCache 1712 | case 2: 1713 | return &v.unknownFields 1714 | default: 1715 | return nil 1716 | } 1717 | } 1718 | file_notestore_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 1719 | switch v := v.(*AttachmentInfo); i { 1720 | case 0: 1721 | return &v.state 1722 | case 1: 1723 | return &v.sizeCache 1724 | case 2: 1725 | return &v.unknownFields 1726 | default: 1727 | return nil 1728 | } 1729 | } 1730 | file_notestore_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 1731 | switch v := v.(*Font); i { 1732 | case 0: 1733 | return &v.state 1734 | case 1: 1735 | return &v.sizeCache 1736 | case 2: 1737 | return &v.unknownFields 1738 | default: 1739 | return nil 1740 | } 1741 | } 1742 | file_notestore_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 1743 | switch v := v.(*ParagraphStyle); i { 1744 | case 0: 1745 | return &v.state 1746 | case 1: 1747 | return &v.sizeCache 1748 | case 2: 1749 | return &v.unknownFields 1750 | default: 1751 | return nil 1752 | } 1753 | } 1754 | file_notestore_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { 1755 | switch v := v.(*Checklist); i { 1756 | case 0: 1757 | return &v.state 1758 | case 1: 1759 | return &v.sizeCache 1760 | case 2: 1761 | return &v.unknownFields 1762 | default: 1763 | return nil 1764 | } 1765 | } 1766 | file_notestore_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { 1767 | switch v := v.(*DictionaryElement); i { 1768 | case 0: 1769 | return &v.state 1770 | case 1: 1771 | return &v.sizeCache 1772 | case 2: 1773 | return &v.unknownFields 1774 | default: 1775 | return nil 1776 | } 1777 | } 1778 | file_notestore_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { 1779 | switch v := v.(*Dictionary); i { 1780 | case 0: 1781 | return &v.state 1782 | case 1: 1783 | return &v.sizeCache 1784 | case 2: 1785 | return &v.unknownFields 1786 | default: 1787 | return nil 1788 | } 1789 | } 1790 | file_notestore_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { 1791 | switch v := v.(*ObjectID); i { 1792 | case 0: 1793 | return &v.state 1794 | case 1: 1795 | return &v.sizeCache 1796 | case 2: 1797 | return &v.unknownFields 1798 | default: 1799 | return nil 1800 | } 1801 | } 1802 | file_notestore_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { 1803 | switch v := v.(*RegisterLatest); i { 1804 | case 0: 1805 | return &v.state 1806 | case 1: 1807 | return &v.sizeCache 1808 | case 2: 1809 | return &v.unknownFields 1810 | default: 1811 | return nil 1812 | } 1813 | } 1814 | file_notestore_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { 1815 | switch v := v.(*MapEntry); i { 1816 | case 0: 1817 | return &v.state 1818 | case 1: 1819 | return &v.sizeCache 1820 | case 2: 1821 | return &v.unknownFields 1822 | default: 1823 | return nil 1824 | } 1825 | } 1826 | file_notestore_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { 1827 | switch v := v.(*AttributeRun); i { 1828 | case 0: 1829 | return &v.state 1830 | case 1: 1831 | return &v.sizeCache 1832 | case 2: 1833 | return &v.unknownFields 1834 | default: 1835 | return nil 1836 | } 1837 | } 1838 | file_notestore_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { 1839 | switch v := v.(*NoteStoreProto); i { 1840 | case 0: 1841 | return &v.state 1842 | case 1: 1843 | return &v.sizeCache 1844 | case 2: 1845 | return &v.unknownFields 1846 | default: 1847 | return nil 1848 | } 1849 | } 1850 | file_notestore_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { 1851 | switch v := v.(*Document); i { 1852 | case 0: 1853 | return &v.state 1854 | case 1: 1855 | return &v.sizeCache 1856 | case 2: 1857 | return &v.unknownFields 1858 | default: 1859 | return nil 1860 | } 1861 | } 1862 | file_notestore_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { 1863 | switch v := v.(*Note); i { 1864 | case 0: 1865 | return &v.state 1866 | case 1: 1867 | return &v.sizeCache 1868 | case 2: 1869 | return &v.unknownFields 1870 | default: 1871 | return nil 1872 | } 1873 | } 1874 | file_notestore_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { 1875 | switch v := v.(*MergableDataProto); i { 1876 | case 0: 1877 | return &v.state 1878 | case 1: 1879 | return &v.sizeCache 1880 | case 2: 1881 | return &v.unknownFields 1882 | default: 1883 | return nil 1884 | } 1885 | } 1886 | file_notestore_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { 1887 | switch v := v.(*MergableDataObject); i { 1888 | case 0: 1889 | return &v.state 1890 | case 1: 1891 | return &v.sizeCache 1892 | case 2: 1893 | return &v.unknownFields 1894 | default: 1895 | return nil 1896 | } 1897 | } 1898 | file_notestore_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { 1899 | switch v := v.(*MergeableDataObjectData); i { 1900 | case 0: 1901 | return &v.state 1902 | case 1: 1903 | return &v.sizeCache 1904 | case 2: 1905 | return &v.unknownFields 1906 | default: 1907 | return nil 1908 | } 1909 | } 1910 | file_notestore_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { 1911 | switch v := v.(*MergeableDataObjectEntry); i { 1912 | case 0: 1913 | return &v.state 1914 | case 1: 1915 | return &v.sizeCache 1916 | case 2: 1917 | return &v.unknownFields 1918 | default: 1919 | return nil 1920 | } 1921 | } 1922 | file_notestore_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { 1923 | switch v := v.(*MergeableDataObjectMap); i { 1924 | case 0: 1925 | return &v.state 1926 | case 1: 1927 | return &v.sizeCache 1928 | case 2: 1929 | return &v.unknownFields 1930 | default: 1931 | return nil 1932 | } 1933 | } 1934 | file_notestore_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { 1935 | switch v := v.(*OrderedSet); i { 1936 | case 0: 1937 | return &v.state 1938 | case 1: 1939 | return &v.sizeCache 1940 | case 2: 1941 | return &v.unknownFields 1942 | default: 1943 | return nil 1944 | } 1945 | } 1946 | file_notestore_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { 1947 | switch v := v.(*OrderedSetOrdering); i { 1948 | case 0: 1949 | return &v.state 1950 | case 1: 1951 | return &v.sizeCache 1952 | case 2: 1953 | return &v.unknownFields 1954 | default: 1955 | return nil 1956 | } 1957 | } 1958 | file_notestore_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { 1959 | switch v := v.(*OrderedSetOrderingArray); i { 1960 | case 0: 1961 | return &v.state 1962 | case 1: 1963 | return &v.sizeCache 1964 | case 2: 1965 | return &v.unknownFields 1966 | default: 1967 | return nil 1968 | } 1969 | } 1970 | file_notestore_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { 1971 | switch v := v.(*OrderedSetOrderingArrayAttachment); i { 1972 | case 0: 1973 | return &v.state 1974 | case 1: 1975 | return &v.sizeCache 1976 | case 2: 1977 | return &v.unknownFields 1978 | default: 1979 | return nil 1980 | } 1981 | } 1982 | } 1983 | type x struct{} 1984 | out := protoimpl.TypeBuilder{ 1985 | File: protoimpl.DescBuilder{ 1986 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 1987 | RawDescriptor: file_notestore_proto_rawDesc, 1988 | NumEnums: 0, 1989 | NumMessages: 23, 1990 | NumExtensions: 0, 1991 | NumServices: 0, 1992 | }, 1993 | GoTypes: file_notestore_proto_goTypes, 1994 | DependencyIndexes: file_notestore_proto_depIdxs, 1995 | MessageInfos: file_notestore_proto_msgTypes, 1996 | }.Build() 1997 | File_notestore_proto = out.File 1998 | file_notestore_proto_rawDesc = nil 1999 | file_notestore_proto_goTypes = nil 2000 | file_notestore_proto_depIdxs = nil 2001 | } 2002 | -------------------------------------------------------------------------------- /search_notes/proto/notestore.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | // 4 | // Common classes used across a few types 5 | // 6 | 7 | //Represents a color 8 | message Color { 9 | required float red = 1; 10 | required float green = 2; 11 | required float blue = 3; 12 | required float alpha = 4; 13 | } 14 | 15 | // Represents an attachment (embedded object) 16 | message AttachmentInfo { 17 | optional string attachment_identifier = 1; 18 | optional string type_uti = 2; 19 | } 20 | 21 | // Represents a font 22 | message Font { 23 | optional string font_name = 1; 24 | optional float point_size = 2; 25 | optional int32 font_hints = 3; 26 | } 27 | 28 | // Styles a "Paragraph" (any run of characters in an AttributeRun) 29 | message ParagraphStyle { 30 | optional int32 style_type = 1 [default = -1]; 31 | optional int32 alignment = 2; 32 | optional int32 indent_amount = 4; 33 | optional Checklist checklist = 5; 34 | } 35 | 36 | // Represents a checklist item 37 | message Checklist { 38 | required bytes uuid = 1; 39 | required int32 done = 2; 40 | } 41 | 42 | // Represents an object that has pointers to a key and a value, asserting 43 | // somehow that the key object has to do with the value object. 44 | message DictionaryElement { 45 | required ObjectID key = 1; 46 | required ObjectID value = 2; 47 | } 48 | 49 | // A Dictionary holds many DictionaryElements 50 | message Dictionary { 51 | repeated DictionaryElement element = 1; 52 | } 53 | 54 | // ObjectIDs are used to identify objects within the protobuf, offsets in an arry, or 55 | // a simple String. 56 | message ObjectID { 57 | required uint64 unsigned_integer_value = 2; 58 | required string string_value = 4; 59 | required int32 object_index = 6; 60 | } 61 | 62 | // Register Latest is used to identify the most recent version 63 | message RegisterLatest { 64 | required ObjectID contents = 2; 65 | } 66 | 67 | // MapEntries have a key that maps to an array of key items and a value that points to an object. 68 | message MapEntry { 69 | required int32 key = 1; 70 | required ObjectID value = 2; 71 | } 72 | 73 | // Represents a "run" of characters that need to be styled/displayed/etc 74 | message AttributeRun { 75 | required int32 length = 1; 76 | optional ParagraphStyle paragraph_style = 2; 77 | optional Font font = 3; 78 | optional int32 font_weight = 5; 79 | optional int32 underlined = 6; 80 | optional int32 strikethrough = 7; 81 | optional int32 superscript = 8; //Sign indicates super/sub 82 | optional string link = 9; 83 | optional Color color = 10; 84 | optional AttachmentInfo attachment_info = 12; 85 | } 86 | 87 | // 88 | // Classes related to the overall Note protobufs 89 | // 90 | 91 | // Overarching object in a ZNOTEDATA.ZDATA blob 92 | message NoteStoreProto { 93 | required Document document = 2; 94 | } 95 | 96 | // A Document has a Note within it. 97 | message Document { 98 | required int32 version = 2; 99 | required Note note = 3; 100 | } 101 | 102 | // A Note has both text, and then a lot of formatting entries. 103 | // Other fields are present and not yet included in this proto. 104 | message Note { 105 | required string note_text = 2; 106 | repeated AttributeRun attribute_run = 5; 107 | } 108 | 109 | // 110 | // Classes related to embedded objects 111 | // 112 | 113 | // Represents the top level object in a ZMERGEABLEDATA cell 114 | message MergableDataProto { 115 | required MergableDataObject mergable_data_object = 2; 116 | } 117 | 118 | // Similar to Document for Notes, this is what holds the mergeable object 119 | message MergableDataObject { 120 | required int32 version = 2; // Asserted to be version in https://github.com/dunhamsteve/notesutils 121 | required MergeableDataObjectData mergeable_data_object_data = 3; 122 | } 123 | 124 | // This is the mergeable data object itself and has a lot of entries that are the parts of it 125 | // along with arrays of key, type, and UUID items, depending on type. 126 | message MergeableDataObjectData { 127 | repeated MergeableDataObjectEntry mergeable_data_object_entry = 3; 128 | repeated string mergeable_data_object_key_item = 4; 129 | repeated string mergeable_data_object_type_item = 5; 130 | repeated bytes mergeable_data_object_uuid_item = 6; 131 | } 132 | 133 | // Each entry is part of the pbject. For example, one entry might be identifying which 134 | // UUIDs are rows, and another might hold the text of a cell. 135 | message MergeableDataObjectEntry { 136 | required RegisterLatest register_latest = 1; 137 | optional Dictionary dictionary = 6; 138 | optional Note note = 10; 139 | optional MergeableDataObjectMap custom_map = 13; 140 | optional OrderedSet ordered_set = 16; 141 | } 142 | 143 | // The Object Map uses its type to identify what you are looking at and 144 | // then a map entry to do something with that value. 145 | message MergeableDataObjectMap { 146 | required int32 type = 1; 147 | repeated MapEntry map_entry = 3; 148 | } 149 | 150 | // An ordered set is used to hold structural information for embedded tables 151 | message OrderedSet { 152 | required OrderedSetOrdering ordering = 1; 153 | required Dictionary elements = 2; 154 | } 155 | 156 | 157 | // The ordered set ordering identifies rows and columns in embedded tables, with an array 158 | // of the objects and contents that map lookup values to originals. 159 | message OrderedSetOrdering { 160 | required OrderedSetOrderingArray array = 1; 161 | required Dictionary contents = 2; 162 | } 163 | 164 | // This array holds both the text to replace and the array of UUIDs to tell what 165 | // embedded rows and columns are. 166 | message OrderedSetOrderingArray { 167 | required Note contents = 1; 168 | repeated OrderedSetOrderingArrayAttachment attachment = 2; 169 | } 170 | 171 | // This array identifies the UUIDs that are embedded table rows or columns 172 | message OrderedSetOrderingArrayAttachment { 173 | required int32 index = 1; 174 | required bytes uuid = 2; 175 | } 176 | 177 | 178 | -------------------------------------------------------------------------------- /update.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2 2 | import os 3 | import subprocess 4 | import time 5 | import json 6 | import plistlib 7 | 8 | 9 | def oneDaySinceLastCheck(): 10 | ''' 11 | Check whether it's been 24 hours since the last github query. 12 | We keep track of this through the modification time of this file, 13 | which is updated every time we query github. 14 | ''' 15 | lastCheck = os.path.getmtime(__file__) 16 | if time.time() > 24*60*60 + lastCheck: 17 | subprocess.call(['/usr/bin/touch', __file__]) 18 | return True 19 | else: 20 | return False 21 | 22 | 23 | def updateAvailable(latestVersion): 24 | ''' 25 | Check whether the latest version is ahead of the current version. 26 | ''' 27 | currentVersion = plistlib.readPlist(os.path.dirname(__file__) + '/info.plist')['version'] 28 | if str(currentVersion).lower().strip() == str(latestVersion).lower().strip(): 29 | return False 30 | else: 31 | return True 32 | 33 | 34 | def userWantsUpdate(updateNotes): 35 | ''' 36 | Show user a confirmation dialog. 37 | ''' 38 | retval = subprocess.call(['/usr/bin/osascript', '-e', 'display dialog "An update is available for the Alfred Search Notes workflow. You can disable automatic update checks by editing the workflow.\n\nInformation about this release:\n\n%s" with title "Alfred Search Notes Workflow" buttons {"Cancel", "Download"} default button "Download" cancel button "Cancel"' % updateNotes, '2>/dev/null']) 39 | if retval == 0: 40 | return True 41 | else: 42 | return False 43 | 44 | 45 | def update(updateUrl): 46 | ''' 47 | Download and open new version of workflow. 48 | ''' 49 | updateFile = '/tmp/Search.Notes.alfredworkflow' 50 | # --location is required in order to follow redirects 51 | curlRet = subprocess.call(['/usr/bin/curl', '--silent', '--location', '--output', updateFile, updateUrl]) 52 | openRet = 1 53 | if curlRet == 0: 54 | openRet = subprocess.call(['/usr/bin/open', updateFile]) 55 | if curlRet != 0 or openRet != 0: 56 | subprocess.call(['/usr/bin/osascript', '-e', 'display alert "Alfred Search Notes workflow failed to update." as critical', '2>/dev/null']) 57 | 58 | 59 | if oneDaySinceLastCheck(): 60 | latestUrl = 'https://api.github.com/repos/sballin/alfred-search-notes-app/releases/latest' 61 | latestFile = '/tmp/search_notes_latest_release.json' 62 | retval = subprocess.call(['/usr/bin/curl', '--silent', '--max-time', '30', '--output', latestFile, latestUrl]) 63 | if retval == 0: 64 | with open(latestFile, 'r') as f: 65 | latest = json.load(f) 66 | latestVersion = latest['tag_name'] 67 | updateNotes = latest['body'] 68 | updateUrl = latest['assets'][0]['browser_download_url'] 69 | 70 | if updateAvailable(latestVersion): 71 | if userWantsUpdate(updateNotes): 72 | update(updateUrl) 73 | --------------------------------------------------------------------------------