applenotes

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: MIT Imports: 36 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeNote

func DecodeNote(ctx context.Context, cfg config.Config, opts Options, noteID string) (NoteDocument, SnapshotInfo, error)

func DecodeZData

func DecodeZData(data []byte) (string, error)

func PlatformSupported

func PlatformSupported() bool

func ReadDocuments

func ReadDocuments(ctx context.Context, cfg config.Config, opts Options) ([]NoteDocument, SnapshotInfo, error)

Types

type Attachment

type Attachment struct {
	ID            string         `json:"id,omitempty"`
	Name          string         `json:"name,omitempty"`
	ContentID     string         `json:"content_id,omitempty"`
	URL           string         `json:"url,omitempty"`
	FileName      string         `json:"file_name,omitempty"`
	FilePath      string         `json:"file_path,omitempty"`
	MIMEType      string         `json:"mime_type,omitempty"`
	UTI           string         `json:"uti,omitempty"`
	ByteSize      int64          `json:"byte_size,omitempty"`
	CreatedAt     string         `json:"created_at,omitempty"`
	UpdatedAt     string         `json:"updated_at,omitempty"`
	Shared        bool           `json:"shared,omitempty"`
	Text          string         `json:"text,omitempty"`
	ExtractStatus string         `json:"extract_status,omitempty"`
	ExtractTool   string         `json:"extract_tool,omitempty"`
	ExtractedAt   string         `json:"extracted_at,omitempty"`
	ExtractError  string         `json:"extract_error,omitempty"`
	BlockedReason string         `json:"blocked_reason,omitempty"`
	Raw           map[string]any `json:"raw,omitempty"`
}

type NoteDocument

type NoteDocument struct {
	SourceKey         string         `json:"source_key"`
	ExternalID        string         `json:"external_id"`
	CanonicalURL      string         `json:"canonical_url"`
	Title             string         `json:"title"`
	Text              string         `json:"text"`
	Snippet           string         `json:"snippet,omitempty"`
	AccountName       string         `json:"account_name,omitempty"`
	FolderPath        string         `json:"folder_path,omitempty"`
	CreatedAt         string         `json:"created_at,omitempty"`
	UpdatedAt         string         `json:"updated_at,omitempty"`
	PasswordProtected bool           `json:"password_protected"`
	Shared            bool           `json:"shared"`
	Deleted           bool           `json:"deleted"`
	BlockedReason     string         `json:"blocked_reason,omitempty"`
	Links             []string       `json:"links,omitempty"`
	AppleNoteTags     []string       `json:"apple_note_tags,omitempty"`
	Attachments       []Attachment   `json:"attachments,omitempty"`
	AttachmentTexts   []string       `json:"attachment_texts,omitempty"`
	Raw               map[string]any `json:"raw,omitempty"`
}

type Options

type Options struct {
	DBPath             string
	SnapshotDir        string
	KeepSnapshot       bool
	Limit              int
	DryRun             bool
	ShowTitles         bool
	Force              bool
	SkipAttachments    bool
	SkipAttachmentOCR  bool
	AttachmentMaxBytes int64
	TesseractBinary    string
	ExcludeFolders     []string
	ExcludeAccounts    []string
	ExcludeShared      bool
	IncludeLocked      bool
	ForgetExcluded     bool
	Summarize          bool
	SummaryModel       string
	SummaryCLI         string
	SummaryLength      string
	Timeout            time.Duration
	Progress           ProgressFunc
}

type ProbeStats

type ProbeStats struct {
	SourceDBPath string                `json:"source_db_path"`
	Snapshot     SnapshotInfo          `json:"snapshot"`
	Tables       map[string]TableProbe `json:"tables"`
	NoteCount    int                   `json:"note_count"`
	AccountCount int                   `json:"account_count"`
	FolderCount  int                   `json:"folder_count"`
	Warnings     []string              `json:"warnings,omitempty"`
	Duration     time.Duration         `json:"duration"`
}

func Probe

func Probe(ctx context.Context, cfg config.Config, opts Options) (ProbeStats, error)

type ProgressEvent

type ProgressEvent struct {
	Phase           string `json:"phase"`
	Index           int    `json:"index,omitempty"`
	Total           int    `json:"total,omitempty"`
	SourceKey       string `json:"source_key,omitempty"`
	Title           string `json:"title,omitempty"`
	Status          string `json:"status,omitempty"`
	Reason          string `json:"reason,omitempty"`
	Links           int    `json:"links,omitempty"`
	Attachments     int    `json:"attachments,omitempty"`
	TextChars       int    `json:"text_chars,omitempty"`
	AttachmentChars int    `json:"attachment_chars,omitempty"`
	Rendered        bool   `json:"rendered,omitempty"`
	SummaryStatus   string `json:"summary_status,omitempty"`
	SummaryChanged  bool   `json:"summary_changed,omitempty"`
}

type ProgressFunc

type ProgressFunc func(ProgressEvent)

type SnapshotInfo

type SnapshotInfo struct {
	SourceDBPath string   `json:"source_db_path"`
	Dir          string   `json:"dir"`
	DBPath       string   `json:"db_path"`
	CopiedFiles  []string `json:"copied_files"`
	Kept         bool     `json:"kept"`
}

func CreateSnapshot

func CreateSnapshot(cfg config.Config, opts Options) (SnapshotInfo, snapshotCleanup, error)

type Stats

type Stats struct {
	SourceDBPath         string       `json:"source_db_path"`
	Snapshot             SnapshotInfo `json:"snapshot"`
	NotesSeen            int          `json:"notes_seen"`
	NotesMatched         int          `json:"notes_matched"`
	NotesImported        int          `json:"notes_imported"`
	NotesCreated         int          `json:"notes_created"`
	NotesUpdated         int          `json:"notes_updated"`
	NotesUnchanged       int          `json:"notes_unchanged"`
	NotesRendered        int          `json:"notes_rendered"`
	NotesSkipped         int          `json:"notes_skipped"`
	NotesBlocked         int          `json:"notes_blocked"`
	NotesPurged          int          `json:"notes_purged"`
	ExcludedAccounts     int          `json:"excluded_accounts"`
	ExcludedFolders      int          `json:"excluded_folders"`
	ExcludedShared       int          `json:"excluded_shared"`
	BlockedLocked        int          `json:"blocked_locked"`
	BlockedEmpty         int          `json:"blocked_empty"`
	AttachmentsSeen      int          `json:"attachments_seen"`
	AttachmentsIndexed   int          `json:"attachments_indexed"`
	AttachmentsExtracted int          `json:"attachments_extracted"`
	AttachmentsOCRed     int          `json:"attachments_ocred"`
	AttachmentsBlocked   int          `json:"attachments_blocked"`
	LinksDiscovered      int          `json:"links_discovered"`
	SummariesCreated     int          `json:"summaries_created"`
	SummaryErrors        int          `json:"summary_errors"`
	SampleTitles         []string     `json:"sample_titles,omitempty"`
	DryRun               bool         `json:"dry_run"`
	Applied              bool         `json:"applied"`
	Errors               int          `json:"errors"`
}

func Run

func Run(ctx context.Context, cfg config.Config, st *store.Store, opts Options) (Stats, error)

type TableProbe

type TableProbe struct {
	Exists  bool     `json:"exists"`
	Columns []string `json:"columns,omitempty"`
	Rows    int      `json:"rows,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL