rueder frontend
    Preparing search index...

    Class ServerReader

    Implements

    Index
    • Parameters

      • account: Account
      • session: SessionEnds
      • api: {
            acceptTerms: (version: string) => Promise<void>;
            addFolder: (title: string, parentId?: number | null) => Promise<Created>;
            addLabel: (title: string, color: string) => Promise<Created>;
            addRule: (rule: ApiNewRule) => Promise<RuleOutcome>;
            appPasswords: () => Promise<AppPasswords>;
            article: (feedId: number, seq: number) => Promise<Article>;
            articleInfo: (feedId: number, seq: number) => Promise<ArticleInfo>;
            articleSource: (feedId: number, seq: number) => Promise<ArticleSource>;
            beaconReports: (reports: ClientReport[]) => boolean;
            changeEmail: (body: NewEmail) => Promise<Pending>;
            changeLabel: (id: number, change: LabelChange) => Promise<void>;
            changePassword: (body: NewPassword) => Promise<void>;
            changeRule: (id: number, rule: ApiNewRule) => Promise<RuleOutcome>;
            confirmEmail: (token: string) => Promise<Confirmed>;
            confirmSecondFactor: (code: string) => Promise<RecoveryCodes>;
            createAppPassword: (body: NewAppPassword) => Promise<CreatedAppPassword>;
            emailState: () => Promise<EmailState>;
            events: () => EventStream | null;
            exportAccount: () => Promise<string>;
            exportOpml: () => Promise<string>;
            feedInfo: (id: number) => Promise<FeedInfo>;
            findFeeds: (url: string) => Promise<FoundFeeds>;
            finishPasskey: (body: PasskeyRegistration) => Promise<RegisteredPasskey>;
            finishPasskeyLogin: (body: PasskeyAnswer) => Promise<Me>;
            forgotPassword: (name: string) => Promise<void>;
            importAccount: (file: Blob) => Promise<AccountImported>;
            importOpml: (file: Blob) => Promise<OpmlImported>;
            invite: (uses: number) => Promise<MadeInvite>;
            invites: () => Promise<Invites>;
            labels: () => Promise<Label[]>;
            list: (stream: ListStream, page: PageQuery) => Promise<ListItem[]>;
            login: (username: string, password: string, code?: string) => Promise<Me>;
            loginWays: () => Promise<LoginWays>;
            logout: () => Promise<void>;
            me: () => Promise<Me>;
            move: (
                node: NodeRef,
                target: NodeRef,
                position: DropPosition,
            ) => Promise<void>;
            passkeys: () => Promise<Passkeys>;
            previewRule: (rule: ApiNewRule) => Promise<RulePreview>;
            readUpto: (
                stream: ListStream,
                uptoId: number,
                olderThan?: number,
            ) => Promise<void>;
            register: (
                username: string,
                password: string,
                invite?: string,
                acceptedTerms?: string,
                email?: string,
                language?: string,
                captcha?: CaptchaSolution,
            ) => Promise<Me | Awaiting>;
            registering: (invite?: string) => Promise<Registering>;
            removeAccount: (proof: Farewell) => Promise<void>;
            removeEmail: (proof: EmailProof) => Promise<void>;
            removeFolder: (id: number) => Promise<void>;
            removeLabel: (id: number) => Promise<void>;
            removePasskey: (id: number, body: RemovePasskey) => Promise<void>;
            removeRule: (id: number) => Promise<RuleOutcome>;
            renameFeed: (id: number, title: string) => Promise<void>;
            renameFolder: (id: number, title: string) => Promise<void>;
            reportContent: (
                feedId: number,
                seq: number | undefined,
                report: ContentReport,
            ) => Promise<void>;
            reportsConsent: () => Promise<ReportsConsent>;
            resendEmail: (username: string, password: string) => Promise<Pending>;
            resetPassword: (token: string, fresh: string) => Promise<void>;
            revokeAppPassword: (id: number) => Promise<void>;
            revokeInvite: (id: number) => Promise<void>;
            ruleHits: () => Promise<RuleHits[]>;
            rules: () => Promise<Rule[]>;
            saveSettings: (settings: unknown) => Promise<void>;
            search: (
                words: string,
                scope: SearchScope,
                page: SearchPage,
            ) => Promise<SearchHits>;
            secondFactor: () => Promise<SecondFactor>;
            sendReports: (reports: ClientReport[]) => Promise<void>;
            setFetchAgent: (id: number, agent: FetchAgent) => Promise<void>;
            setLabel: (
                feedId: number,
                seq: number,
                labelId: number,
                on: boolean,
            ) => Promise<void>;
            setReportsConsent: (on: boolean) => Promise<void>;
            setState: (
                feedId: number,
                seq: number,
                change: { read?: boolean; starred?: boolean },
            ) => Promise<void>;
            settings: () => Promise<unknown>;
            setUpSecondFactor: (
                body: SecondFactorPassword,
            ) => Promise<SecondFactorSetup>;
            startPasskey: (body: NewPasskey) => Promise<PasskeyChallenge>;
            startPasskeyLogin: () => Promise<PasskeyChallenge>;
            startPasskeyProof: () => Promise<PasskeyChallenge>;
            status: () => Promise<ServerStatus>;
            subscribe: (
                url: string,
                folderId: number | null,
                page?: boolean,
            ) => Promise<number>;
            switchOffSecondFactor: (body: SecondFactorSwitchOff) => Promise<void>;
            tab: string;
            tree: () => Promise<Tree>;
            unsubscribe: (id: number) => Promise<void>;
            versions: (feedId: number, seq: number) => Promise<ArticleVersion[]>;
        } = theApi
        • acceptTerms: (version: string) => Promise<void>
        • addFolder: (title: string, parentId?: number | null) => Promise<Created>
        • addLabel: (title: string, color: string) => Promise<Created>
        • addRule: (rule: ApiNewRule) => Promise<RuleOutcome>
        • appPasswords: () => Promise<AppPasswords>
        • article: (feedId: number, seq: number) => Promise<Article>
        • articleInfo: (feedId: number, seq: number) => Promise<ArticleInfo>
        • articleSource: (feedId: number, seq: number) => Promise<ArticleSource>
        • beaconReports: (reports: ClientReport[]) => boolean

          Sends reports as the page is left: the request outlives the page.

        • changeEmail: (body: NewEmail) => Promise<Pending>

          Mails a link to a new address, which counts once it is opened.

        • changeLabel: (id: number, change: LabelChange) => Promise<void>
        • changePassword: (body: NewPassword) => Promise<void>

          Gives the account another password. The server ends every other session of it and answers with a fresh cookie for this browser.

        • changeRule: (id: number, rule: ApiNewRule) => Promise<RuleOutcome>
        • confirmEmail: (token: string) => Promise<Confirmed>

          Opens the link from a mail, with or without a session.

        • confirmSecondFactor: (code: string) => Promise<RecoveryCodes>
        • createAppPassword: (body: NewAppPassword) => Promise<CreatedAppPassword>
        • emailState: () => Promise<EmailState>

          The account's address and the one that waits for its link.

        • events: () => EventStream | null

          The live updates: one connection that stays open and comes back by itself after a break. Null where the browser has none.

        • exportAccount: () => Promise<string>

          The whole account as a file, for another rueder.

        • exportOpml: () => Promise<string>
        • feedInfo: (id: number) => Promise<FeedInfo>
        • findFeeds: (url: string) => Promise<FoundFeeds>

          The feeds at an address: the feed itself, or those a web page names.

        • finishPasskey: (body: PasskeyRegistration) => Promise<RegisteredPasskey>
        • finishPasskeyLogin: (body: PasskeyAnswer) => Promise<Me>
        • forgotPassword: (name: string) => Promise<void>

          Asks for a link that sets a new password, by the account's name or its address. The server answers the same, with nothing to read, whoever it is.

        • importAccount: (file: Blob) => Promise<AccountImported>

          A file of exportAccount, from this rueder or another, sent as it is.

        • importOpml: (file: Blob) => Promise<OpmlImported>
        • invite: (uses: number) => Promise<MadeInvite>
        • invites: () => Promise<Invites>
        • labels: () => Promise<Label[]>
        • list: (stream: ListStream, page: PageQuery) => Promise<ListItem[]>
        • login: (username: string, password: string, code?: string) => Promise<Me>
        • loginWays: () => Promise<LoginWays>
        • logout: () => Promise<void>
        • me: () => Promise<Me>
        • move: (node: NodeRef, target: NodeRef, position: DropPosition) => Promise<void>
        • passkeys: () => Promise<Passkeys>
        • previewRule: (rule: ApiNewRule) => Promise<RulePreview>

          Tries a rule without storing it; a pattern that cannot be used is refused with 400.

        • readUpto: (stream: ListStream, uptoId: number, olderThan?: number) => Promise<void>

          Marks as read what arrived in the stream up to the article of this id; with olderThan, only what was published more than that many seconds ago.

        • register: (
              username: string,
              password: string,
              invite?: string,
              acceptedTerms?: string,
              email?: string,
              language?: string,
              captcha?: CaptchaSolution,
          ) => Promise<Me | Awaiting>

          Makes an account and logs it in; where every account needs a confirmed address, it is made and waits for its link instead (Awaiting). A refusal is 403 with one word, see NewRegistration.

        • registering: (invite?: string) => Promise<Registering>

          Whether anybody can register, and whether an invitation can be used; for anybody.

        • removeAccount: (proof: Farewell) => Promise<void>

          Deletes the account that is logged in, for good; the password, or the name of one without.

        • removeEmail: (proof: EmailProof) => Promise<void>

          Takes the address from the account, where it is optional.

        • removeFolder: (id: number) => Promise<void>
        • removeLabel: (id: number) => Promise<void>
        • removePasskey: (id: number, body: RemovePasskey) => Promise<void>
        • removeRule: (id: number) => Promise<RuleOutcome>
        • renameFeed: (id: number, title: string) => Promise<void>

          An empty title gives the feed its own name back.

        • renameFolder: (id: number, title: string) => Promise<void>
        • reportContent: (
              feedId: number,
              seq: number | undefined,
              report: ContentReport,
          ) => Promise<void>
        • reportsConsent: () => Promise<ReportsConsent>
        • resendEmail: (username: string, password: string) => Promise<Pending>

          Sends the link again to an account that waits for its address.

        • resetPassword: (token: string, fresh: string) => Promise<void>

          Sets a new password with the token from that link; it does not log in.

        • revokeAppPassword: (id: number) => Promise<void>
        • revokeInvite: (id: number) => Promise<void>
        • ruleHits: () => Promise<RuleHits[]>

          What each of the stored rules finds.

        • rules: () => Promise<Rule[]>
        • saveSettings: (settings: unknown) => Promise<void>
        • search: (words: string, scope: SearchScope, page: SearchPage) => Promise<SearchHits>
        • secondFactor: () => Promise<SecondFactor>
        • sendReports: (reports: ClientReport[]) => Promise<void>
        • setFetchAgent: (id: number, agent: FetchAgent) => Promise<void>

          For admins only.

        • setLabel: (feedId: number, seq: number, labelId: number, on: boolean) => Promise<void>

          Puts a label on an article, or takes it off.

        • setReportsConsent: (on: boolean) => Promise<void>
        • setState: (
              feedId: number,
              seq: number,
              change: { read?: boolean; starred?: boolean },
          ) => Promise<void>
        • settings: () => Promise<unknown>

          The settings as the account keeps them; what is in them is the page's business.

        • setUpSecondFactor: (body: SecondFactorPassword) => Promise<SecondFactorSetup>
        • startPasskey: (body: NewPasskey) => Promise<PasskeyChallenge>

          Starts making a passkey: what to ask the device.

        • startPasskeyLogin: () => Promise<PasskeyChallenge>

          Starts logging in with a passkey: what to ask the device.

        • startPasskeyProof: () => Promise<PasskeyChallenge>

          Starts asking a passkey of the account that its owner is there.

        • status: () => Promise<ServerStatus>

          For admins only.

        • subscribe: (url: string, folderId: number | null, page?: boolean) => Promise<number>

          Subscribes to the feed at an address, or of a web page, and gives back its number.

        • switchOffSecondFactor: (body: SecondFactorSwitchOff) => Promise<void>
        • tab: string

          This tab's name, as the requests carry it.

        • tree: () => Promise<Tree>
        • unsubscribe: (id: number) => Promise<void>
        • versions: (feedId: number, seq: number) => Promise<ArticleVersion[]>

      Returns ServerReader

    account: Account = ...

    Who is logged in; it changes when the account agrees to the terms.

    appsVersion: number = ...

    Counts up when app passwords change or an app logs in for the first time, as the events say; the account's settings (account.svelte.ts) pass it on.

    closed: ReadonlySet<string> = ...

    Folders shown closed in the sidebar; kept in the browser.

    connection: Connection = ...

    Whether what is shown is live, for the sign in the top bar.

    cursor: string | null = ...

    The article the cursor is on, and the one that is open in the list view.

    demo: null

    Only the reader with made-up data has these.

    feeds: Record<string, Feed> = ...
    filters: ServerReader = ...

    The filter rules are this reader's own methods.

    fresh: Fresh[] = ...

    Feeds with something unread among the newest unread articles, the freshest first.

    hiddenCount: number = ...

    How many articles the rules hide, as the server counted them.

    labels: Label[] = ...

    The labels, in the order the server keeps them.

    latestStarred: Article[] = ...
    legal: LegalLinks | null = ...

    The operator's legal texts, as the session found them.

    moved: number = ...

    Counts the steps of the cursor, so the list can scroll to where it went.

    notice: Notice | null = ...

    What went wrong last, until it is closed.

    pending: number = ...

    Articles that arrived in what is shown since the list was loaded.

    reportsConsent: { available: boolean; on: boolean } | null = ...

    Whether the server takes reports of errors, and whether this account sends them; null until asked.

    resuming: boolean = ...

    Whether resume is still looking for the articles it wants.

    rules: FilterRule[] = ...

    The filter rules, in the order the server keeps them.

    stream: Stream = ...

    What the main pane shows.

    totalUnread: number = ...
    tree: TreeNode[] = ...
    unsentChanges: number = ...

    How many changes wait for a server that did not answer.

    visible: Article[] = ...

    What the list shows: what the server found for the search, or, in the lists the server does not search (the starred, the hidden, a label's), the loaded part of the list that has the words.

    • Whether dropping the feed id on the feed targetId can put both into a new folder.

      Parameters

      • id: string
      • targetId: string

      Returns boolean

    • The server gives the new folder its number, so the folder shows once it has it: made in the target's folder, put where the target is, and the two feeds moved into it.

      Parameters

      • id: string
      • targetId: string
      • title: string

      Returns void

    • Everything the account has may have changed, so everything is loaded anew. The other tabs hear of it from the server; this one does not hear its own.

      Parameters

      • file: Blob

      Returns Promise<Moved>

    • Whether a folder of the tree is folded away in the sidebar. The sidebar's own sections use a name instead of a folder's id, labels for one.

      Parameters

      • folderId: string

      Returns boolean

    • Marks as read what the list knew of when it was loaded; what arrived since stays unread. With olderThan, only what was published more than that many milliseconds ago. The lists of the starred and the hidden are not a place to mark everything from.

      Parameters

      • olderThan: number = 0

      Returns void

    • A new name shows at once. An empty one gives the feed its own name back, which only the server knows, so the tree is asked for anew.

      Parameters

      • id: string
      • title: string

      Returns void

    • Reports a feed, or one of its articles, to the admins.

      Parameters

      • target: { feedId: string; seq?: number }
      • reason: "illegal" | "copyright" | "malicious" | "spam" | "other"
      • note: string

      Returns Promise<ReportOutcome>

    • Shows a stream as it was left, with its filters and its open article, before start. The list is loaded far enough to hold the wanted articles and the open one, as far as they are still in it.

      Parameters

      Returns void

    • Sends changed settings once they rest a moment; nothing before the account's are loaded. Like what is read, they wait while the server does not answer: they count as saved from here on, so nothing would send them again.

      Parameters

      Returns void

    • Opens the connection for live updates, then loads the tree, the rules and the start page. Returns how to close the connection again.

      Returns () => void

    • Without a cursor, either step goes to the first article. A step that comes while the list is still on its way, as from the start page, waits for it.

      Parameters

      • by: -1 | 1
      • open: boolean = true

      Returns void

    • The server fetches a feed nobody reads yet before it subscribes, which can take a while; the feed shows once it is there.

      Parameters

      • url: string
      • folderId: string | null
      • page: boolean = false

      Returns Promise<Subscribed>

    • The feed goes from the tree at once; a mixed list is loaded anew once the server has ended the subscription. A rule that holds for the feed stays, as it does on the server, and holds again if the feed is subscribed again.

      Parameters

      • id: string

      Returns void