This commit is contained in:
@@ -6,9 +6,9 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/go-computer/internal/markdown"
|
||||
"github.com/andrew/go-computer/internal/preview"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"github.com/andrew/superbrain/internal/markdown"
|
||||
"github.com/andrew/superbrain/internal/preview"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"math"
|
||||
"net/http"
|
||||
"regexp"
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/andrew/go-computer/internal/auth"
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/superbrain/internal/auth"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"github.com/jackc/pgx/v5/pgconn"
|
||||
"io"
|
||||
"log"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
)
|
||||
|
||||
// Structured export (trust phase): a single owner-scoped JSON archive that is
|
||||
@@ -68,9 +68,9 @@ func HandleExport(w http.ResponseWriter, r *http.Request) {
|
||||
detail["items"], detail["sharedWith"] = items, shares
|
||||
exported = append(exported, detail)
|
||||
}
|
||||
w.Header().Set("Content-Disposition", `attachment; filename="computer-export.json"`)
|
||||
w.Header().Set("Content-Disposition", `attachment; filename="superbrain-export.json"`)
|
||||
respond(w, 200, object{
|
||||
"format": "computer-export",
|
||||
"format": "superbrain-export",
|
||||
"version": 1,
|
||||
"exportedAt": time.Now().UTC(),
|
||||
"user": me,
|
||||
|
||||
@@ -2,8 +2,8 @@ package handlers
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/go-computer/internal/kanban"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"github.com/andrew/superbrain/internal/kanban"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -5,12 +5,12 @@ import (
|
||||
"database/sql"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"github.com/andrew/go-computer/internal/config"
|
||||
crypt "github.com/andrew/go-computer/internal/crypto"
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/go-computer/internal/netguard"
|
||||
"github.com/andrew/go-computer/internal/outbound"
|
||||
"github.com/andrew/go-computer/internal/signals"
|
||||
"github.com/andrew/superbrain/internal/config"
|
||||
crypt "github.com/andrew/superbrain/internal/crypto"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"github.com/andrew/superbrain/internal/netguard"
|
||||
"github.com/andrew/superbrain/internal/outbound"
|
||||
"github.com/andrew/superbrain/internal/signals"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
@@ -65,9 +65,9 @@ func TestParseVCardSubset(t *testing.T) {
|
||||
"UID:uid-1\r\n" +
|
||||
"item1.FN:Preferred Name\r\n" +
|
||||
"item1.X-ABLabel:Main\r\n" +
|
||||
"EMAIL;TYPE=WORK:work@computer.test\r\n" +
|
||||
"EMAIL;TYPE=PREF:pref@computer.test\r\n" +
|
||||
"EMAIL:plain@computer.test\r\n" +
|
||||
"EMAIL;TYPE=WORK:work@superbrain.test\r\n" +
|
||||
"EMAIL;TYPE=PREF:pref@superbrain.test\r\n" +
|
||||
"EMAIL:plain@superbrain.test\r\n" +
|
||||
"TEL;TYPE=HOME,VOICE:+1 555 0100\r\n" +
|
||||
"NOTE:folded line\r\n" +
|
||||
" continuation\r\n" +
|
||||
@@ -87,7 +87,7 @@ func TestParseVCardSubset(t *testing.T) {
|
||||
if len(v["EMAIL"]) != 3 {
|
||||
t.Fatalf("repeated EMAILs not preserved: %d", len(v["EMAIL"]))
|
||||
}
|
||||
if got := vCardPick(v["EMAIL"]); got != "pref@computer.test" {
|
||||
if got := vCardPick(v["EMAIL"]); got != "pref@superbrain.test" {
|
||||
t.Fatalf("PREF selection = %q", got)
|
||||
}
|
||||
// vCard 4.0 numeric PREF ranks below any TYPE=PREF-free occurrence.
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
)
|
||||
|
||||
// Connected pages (Notion-like upgrades phase 3).
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
// Page hierarchy, internal links and embedded collection views are all
|
||||
// expressed in the page's Markdown, which stays the single source of truth:
|
||||
//
|
||||
// - [Any label](computer:page/<id>) links to another page. /pages?id=<id>
|
||||
// - [Any label](superbrain:page/<id>) links to another page. /pages?id=<id>
|
||||
// and page/<id> are accepted as aliases so hand-written links work too.
|
||||
// - {{collection:<id>}} embeds a live collection view; an optional
|
||||
// {{collection:<id>|view=<viewId>}} pins a saved view's filters/sorts.
|
||||
@@ -38,10 +38,10 @@ func internalPageID(href string) (string, bool) {
|
||||
href = strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(href, "<"), ">"))
|
||||
raw := ""
|
||||
switch {
|
||||
case strings.HasPrefix(href, "computer://page/"):
|
||||
raw = strings.TrimPrefix(href, "computer://page/")
|
||||
case strings.HasPrefix(href, "computer:page/"):
|
||||
raw = strings.TrimPrefix(href, "computer:page/")
|
||||
case strings.HasPrefix(href, "superbrain://page/"):
|
||||
raw = strings.TrimPrefix(href, "superbrain://page/")
|
||||
case strings.HasPrefix(href, "superbrain:page/"):
|
||||
raw = strings.TrimPrefix(href, "superbrain:page/")
|
||||
case strings.HasPrefix(href, "page/"):
|
||||
raw = strings.TrimPrefix(href, "page/")
|
||||
case strings.HasPrefix(href, "/pages/"):
|
||||
@@ -50,11 +50,11 @@ func internalPageID(href string) (string, bool) {
|
||||
if u, err := url.Parse(href); err == nil {
|
||||
raw = u.Query().Get("id")
|
||||
}
|
||||
case strings.HasPrefix(href, "computer:page?id="):
|
||||
case strings.HasPrefix(href, "superbrain:page?id="):
|
||||
if u, err := url.Parse(href); err == nil {
|
||||
raw = u.Query().Get("id")
|
||||
}
|
||||
case strings.HasPrefix(href, "computer://page?id="):
|
||||
case strings.HasPrefix(href, "superbrain://page?id="):
|
||||
if u, err := url.Parse(href); err == nil {
|
||||
raw = u.Query().Get("id")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
)
|
||||
|
||||
// Page revision history (trust phase). Every committed content version gets
|
||||
|
||||
@@ -3,8 +3,8 @@ package handlers
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/go-computer/internal/markdown"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"github.com/andrew/superbrain/internal/markdown"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -3,9 +3,9 @@ package handlers
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/go-computer/internal/outbound"
|
||||
"github.com/andrew/go-computer/internal/signals"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"github.com/andrew/superbrain/internal/outbound"
|
||||
"github.com/andrew/superbrain/internal/signals"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -2,7 +2,7 @@ package handlers
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
)
|
||||
|
||||
// Recoverable deletions (trust phase).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/andrew/go-computer/internal/db"
|
||||
"github.com/andrew/superbrain/internal/db"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user