From f52043f27f1bab5b4433d6596017f8373294c2f2 Mon Sep 17 00:00:00 2001 From: brandonphelps1212 Date: Thu, 19 Nov 2026 19:28:36 -0500 Subject: [PATCH 1/3] add the appwrite plugin Watches appwrite/specs (the newest minor's server operations at the newest commit) for operation deprecations, quoting x-appwrite.deprecated. SDK method renames flagged deprecated are not read as deprecations, and removals are never events. Adds two diff options, QuoteDeprecated and FlagNotDeprecation; their zero values keep every other plugin's output unchanged. Co-Authored-By: Claude Opus 5.5 Signed-off-by: brandonphelps1212 --- README.md | 2 +- adapter/appwrite.go | 218 ++ adapter/appwrite_test.go | 130 + diff/diff.go | 60 +- diff/options_test.go | 44 + docs/plugins.json | 12 +- docs/plugins.md | 1 + plugins/openapi/appwrite.go | 67 + plugins/openapi/appwrite_test.go | 206 ++ plugins/openapi/openapi.go | 4 + plugins/openapi/testdata/README.md | 5 + .../appwrite-1.7.x-ac705cd3-server.json | 1745 +++++++++ .../appwrite-1.8.x-ac705cd3-server.json | 3122 +++++++++++++++++ .../appwrite-1.9.x-7d74bf9f-server.json | 1461 ++++++++ .../appwrite-1.9.x-8c00ba35-server.json | 1405 ++++++++ .../testdata/appwrite-2.4.x-06e6fafa.json | 1317 +++++++ .../testdata/appwrite-2.4.x-98cc1a25.json | 1332 +++++++ plugins/openapi/testdata/golden/appwrite.json | 296 ++ providers/README.md | 1 + providers/appwrite.md | 49 + 20 files changed, 11470 insertions(+), 7 deletions(-) create mode 100644 adapter/appwrite.go create mode 100644 adapter/appwrite_test.go create mode 100644 plugins/openapi/appwrite.go create mode 100644 plugins/openapi/appwrite_test.go create mode 100644 plugins/openapi/testdata/appwrite-1.7.x-ac705cd3-server.json create mode 100644 plugins/openapi/testdata/appwrite-1.8.x-ac705cd3-server.json create mode 100644 plugins/openapi/testdata/appwrite-1.9.x-7d74bf9f-server.json create mode 100644 plugins/openapi/testdata/appwrite-1.9.x-8c00ba35-server.json create mode 100644 plugins/openapi/testdata/appwrite-2.4.x-06e6fafa.json create mode 100644 plugins/openapi/testdata/appwrite-2.4.x-98cc1a25.json create mode 100644 plugins/openapi/testdata/golden/appwrite.json create mode 100644 providers/appwrite.md diff --git a/README.md b/README.md index 2bd82bf..b25e164 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/patch-it-dev/patch-it-plugins.svg)](https://pkg.go.dev/github.com/patch-it-dev/patch-it-plugins) [![Go version](https://img.shields.io/github/go-mod/go-version/patch-it-dev/patch-it-plugins)](go.mod) [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-3f5bf0)](LICENSE) -[![Plugins](https://img.shields.io/badge/plugins-24-3f5bf0)](docs/plugins.md) +[![Plugins](https://img.shields.io/badge/plugins-25-3f5bf0)](docs/plugins.md) [![Docs](https://img.shields.io/badge/docs-docs.patch--it.dev-3f5bf0)](https://docs.patch-it.dev) [![Discussions](https://img.shields.io/github/discussions/patch-it-dev/patch-it-plugins)](https://github.com/patch-it-dev/patch-it-plugins/discussions) diff --git a/adapter/appwrite.go b/adapter/appwrite.go new file mode 100644 index 0000000..4759d9a --- /dev/null +++ b/adapter/appwrite.go @@ -0,0 +1,218 @@ +package adapter + +import ( + "bytes" + "cmp" + "context" + "encoding/json" + "fmt" + "regexp" + "slices" + "strconv" + "strings" + + "github.com/patch-it-dev/patch-it-plugins/fetch" +) + +var ( + // appwriteCommit is a full appwrite/specs commit SHA. + appwriteCommit = regexp.MustCompile(`^[0-9a-f]{40}$`) + // appwriteDir is one minor's directory under specs/: "1.9.x", "2.7.x". + appwriteDir = regexp.MustCompile(`^(\d+)\.(\d+)\.x$`) +) + +// appwriteMethods are the operation keys a path item can hold. +var appwriteMethods = []string{"get", "put", "post", "delete", "patch", "head", "options", "trace"} + +// Appwrite adapts Appwrite's REST API spec in appwrite/specs (BSD-3-Clause) +// for the openapi plugin. The repo has one directory per server minor, +// specs/.x/, and no tags or releases (checked 2026-11-19), so a tag here +// is a commit SHA: the newest minor's spec at that commit. To replay an older +// minor, a tag can name its directory, "1.8.x@". +// +// A directory holds one of two layouts: +// +// - open-api3-.x.json, one document for every platform, each +// operation listing the SDK platforms it's on in x-appwrite.platforms +// (console, client, server, manager): from 2.0.x on, the only layout up +// to 2.2.x; +// - open-api3-.x-server.json, one document per platform: up to +// 1.9.x, and alongside the single document in 2.3.x and 2.4.x. +// +// Fetch reads the single document when the directory has one, keeping the +// operations on the server platform, and the server document otherwise: +// what an Appwrite server SDK (a repo's backend code) can call. Filtered +// this way, the single document has the operations the server document has +// at the same commit: 1.9.x's and 2.0.x's at 0ccd20ab (2026-09-07, which +// added 2.0.x), 2.4.x's two at 98cc1a25 (2026-10-08). Where they part, the +// single document is the one kept up: 06e6fafa (2026-10-12) took the +// server platform off 13 operations in 2.4.x's single document only ("it +// listed server and client methods no released SDK ships yet"). +// +// The zero value reads GitHub. The fields point it at another server, for +// tests. +type Appwrite struct { + APIBase string // GitHub's REST API; "" is https://api.github.com + RawBase string // files at a commit; "" is https://raw.githubusercontent.com +} + +var _ Adapter = Appwrite{} + +func (Appwrite) API() string { return "appwrite" } + +func (a Appwrite) api(path string) string { + return cmp.Or(a.APIBase, "https://api.github.com") + "/repos/appwrite/specs" + path +} + +// LatestTag is the newest commit on appwrite/specs' default branch that +// changed specs/. +func (a Appwrite) LatestTag(ctx context.Context) (string, error) { + body, err := fetch.Get(ctx, a.api("/commits?path=specs&per_page=1"), githubHeaders()) + if err != nil { + return "", fmt.Errorf("looking up appwrite's latest spec commit: %w", err) + } + var commits []struct { + SHA string `json:"sha"` + } + if err := json.Unmarshal(body, &commits); err != nil { + return "", fmt.Errorf("parsing github commits response: %w", err) + } + if len(commits) == 0 || !appwriteCommit.MatchString(commits[0].SHA) { + return "", fmt.Errorf("github lists no commit that changed appwrite's specs") + } + return commits[0].SHA, nil +} + +// Fetch downloads the spec at a commit: the newest minor's directory, or the +// one the tag names ("1.8.x@"). +// +// Version is the spec's info.version, the Appwrite server version it +// describes ("1.9.5", "2.7.2"): the version the server SDKs send as +// X-Appwrite-Response-Format. +func (a Appwrite) Fetch(ctx context.Context, tag string) (Spec, error) { + dir, sha, named := strings.Cut(tag, "@") + if !named { + dir, sha = "", tag + } + if !appwriteCommit.MatchString(sha) || (named && !appwriteDir.MatchString(dir)) { + return Spec{}, fmt.Errorf("%q is neither a full appwrite/specs commit sha nor .x@", tag) + } + if dir == "" { + dirs, err := a.list(ctx, "specs", sha) + if err != nil { + return Spec{}, err + } + if dir = newestAppwriteDir(dirs); dir == "" { + return Spec{}, fmt.Errorf("appwrite/specs %s has no specs/.x directory", sha) + } + } + files, err := a.list(ctx, "specs/"+dir, sha) + if err != nil { + return Spec{}, err + } + single, server := "open-api3-"+dir+".json", "open-api3-"+dir+"-server.json" + var file string + switch { + case slices.Contains(files, single): + file = single + case slices.Contains(files, server): + file = server + default: + return Spec{}, fmt.Errorf("appwrite/specs %s: specs/%s has neither %s nor %s", sha, dir, single, server) + } + url := cmp.Or(a.RawBase, "https://raw.githubusercontent.com") + "/appwrite/specs/" + sha + "/specs/" + dir + "/" + file + body, err := fetch.Get(ctx, url, nil) // raw.githubusercontent.com needs no auth + if err != nil { + return Spec{}, fmt.Errorf("fetching appwrite spec %s: %w", tag, err) + } + if file == single { + if body, err = appwriteServerOnly(body); err != nil { + return Spec{}, fmt.Errorf("appwrite spec %s: %w", tag, err) + } + } + var doc struct { + Info struct { + Version string `json:"version"` + } `json:"info"` + } + if err := json.Unmarshal(body, &doc); err != nil { + return Spec{}, fmt.Errorf("appwrite spec %s is not valid json: %w", tag, err) + } + if doc.Info.Version == "" { + return Spec{}, fmt.Errorf("appwrite spec %s has no info.version", tag) + } + return Spec{Content: body, Version: doc.Info.Version, SourceURL: url}, nil +} + +// list is the names in a directory of appwrite/specs at a commit. +func (a Appwrite) list(ctx context.Context, path, sha string) ([]string, error) { + body, err := fetch.Get(ctx, a.api("/contents/"+path+"?ref="+sha), githubHeaders()) + if err != nil { + return nil, fmt.Errorf("listing appwrite/specs %s at %s: %w", path, sha, err) + } + var entries []struct { + Name string `json:"name"` + } + if err := json.Unmarshal(body, &entries); err != nil { + return nil, fmt.Errorf("parsing github contents of %s: %w", path, err) + } + names := make([]string, 0, len(entries)) + for _, e := range entries { + names = append(names, e.Name) + } + return names, nil +} + +// newestAppwriteDir is the highest .x by number ("2.10.x" above +// "2.9.x"), or "". specs/ also has "latest", a copy of the newest minor's +// spec under another name, which is left out: the minor's own directory +// says which minor it is. +func newestAppwriteDir(names []string) string { + best, bestV := "", [2]int{-1, -1} + for _, n := range names { + m := appwriteDir.FindStringSubmatch(n) + if m == nil { + continue + } + major, _ := strconv.Atoi(m[1]) + minor, _ := strconv.Atoi(m[2]) + if v := [2]int{major, minor}; cmp.Or(cmp.Compare(v[0], bestV[0]), cmp.Compare(v[1], bestV[1])) > 0 { + best, bestV = n, v + } + } + return best +} + +// appwriteServerOnly keeps the operations of the single document whose +// x-appwrite.platforms has "server", and drops a path left with none. The +// kept values are unchanged (numbers kept as written) and nothing moves, so +// a pointer into what's kept names the same node in the published file. +func appwriteServerOnly(body []byte) ([]byte, error) { + dec := json.NewDecoder(bytes.NewReader(body)) + dec.UseNumber() + var doc map[string]any + if err := dec.Decode(&doc); err != nil { + return nil, fmt.Errorf("parsing the spec: %w", err) + } + paths := asMap(doc["paths"]) + for p, v := range paths { + item := asMap(v) + left := 0 + for _, m := range appwriteMethods { + op, ok := item[m] + if !ok { + continue + } + platforms := asSlice(asMap(asMap(op)["x-appwrite"])["platforms"]) + if slices.Contains(platforms, any("server")) { + left++ + } else { + delete(item, m) + } + } + if left == 0 { + delete(paths, p) + } + } + return json.Marshal(doc) +} diff --git a/adapter/appwrite_test.go b/adapter/appwrite_test.go new file mode 100644 index 0000000..88c75f9 --- /dev/null +++ b/adapter/appwrite_test.go @@ -0,0 +1,130 @@ +package adapter + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +const appwriteSHA = "06e6fafa4d1ae3c815843ff0b02a56e6e5582756" + +// fakeAppwriteGitHub serves the commits list, directory listings +// ("?ref=" -> names) and raw files ("//specs//"). +func fakeAppwriteGitHub(t *testing.T, commits string, listings, raw map[string]string) Appwrite { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + const repo = "/api/repos/appwrite/specs" + switch { + case r.URL.Path == repo+"/commits": + if r.URL.Query().Get("path") != "specs" { + http.Error(w, "want path=specs", http.StatusBadRequest) + return + } + w.Write([]byte(commits)) + case strings.HasPrefix(r.URL.Path, repo+"/contents/"): + names, ok := listings[strings.TrimPrefix(r.URL.Path, repo+"/contents/")+"?ref="+r.URL.Query().Get("ref")] + if !ok { + http.NotFound(w, r) + return + } + var entries []map[string]string + for _, n := range strings.Fields(names) { + entries = append(entries, map[string]string{"name": n}) + } + json.NewEncoder(w).Encode(entries) + default: + body, ok := raw[strings.TrimPrefix(r.URL.Path, "/raw/appwrite/specs")] + if !ok { + http.NotFound(w, r) + return + } + w.Write([]byte(body)) + } + })) + t.Cleanup(srv.Close) + return Appwrite{APIBase: srv.URL + "/api", RawBase: srv.URL + "/raw"} +} + +func TestAppwriteLatestTagIsTheNewestSpecsCommit(t *testing.T) { + a := fakeAppwriteGitHub(t, `[{"sha":"`+appwriteSHA+`"},{"sha":"older"}]`, nil, nil) + if tag, err := a.LatestTag(context.Background()); err != nil || tag != appwriteSHA { + t.Errorf("got %q, %v; want %s", tag, err, appwriteSHA) + } + for _, body := range []string{`[]`, `[{"sha":"short"}]`, `{}`} { + a := fakeAppwriteGitHub(t, body, nil, nil) + if _, err := a.LatestTag(context.Background()); err == nil { + t.Errorf("%s: want an error", body) + } + } +} + +// The single document wins over the server one, filtered to the server +// platform; the newest minor is the highest by number, not "latest" and not +// by string order. +func TestAppwriteFetchReadsTheNewestMinorsServerOperations(t *testing.T) { + const doc = `{"openapi":"3.0.0","info":{"version":"2.10.1"},"paths":{` + + `"/both":{"get":{"x-appwrite":{"platforms":["client","server"]},"x-n":1.50},"post":{"x-appwrite":{"platforms":["console"]}}},` + + `"/console":{"get":{"x-appwrite":{"platforms":["console"]}},"parameters":[]}}}` + a := fakeAppwriteGitHub(t, "", map[string]string{ + "specs?ref=" + appwriteSHA: "1.9.x 2.9.x 2.10.x latest README.md", + "specs/2.10.x?ref=" + appwriteSHA: "open-api3-2.10.x-server.json open-api3-2.10.x.json", + }, map[string]string{"/" + appwriteSHA + "/specs/2.10.x/open-api3-2.10.x.json": doc}) + spec, err := a.Fetch(context.Background(), appwriteSHA) + if err != nil { + t.Fatal(err) + } + if spec.Version != "2.10.1" || !strings.HasSuffix(spec.SourceURL, "/raw/appwrite/specs/"+appwriteSHA+"/specs/2.10.x/open-api3-2.10.x.json") { + t.Errorf("version %q, url %s", spec.Version, spec.SourceURL) + } + if want := `{"info":{"version":"2.10.1"},"openapi":"3.0.0","paths":{"/both":{"get":{"x-appwrite":{"platforms":["client","server"]},"x-n":1.50}}}}`; string(spec.Content) != want { + t.Errorf("content %s, want %s", spec.Content, want) + } +} + +// A per-platform directory is read as published; a tag can name the +// directory to read an older minor. +func TestAppwriteFetchServerDocumentAndNamedDirectory(t *testing.T) { + const doc = `{"openapi":"3.0.0","info":{"version":"1.7.4"},"paths":{"/a":{"get":{}}}}` + a := fakeAppwriteGitHub(t, "", map[string]string{ + "specs/1.7.x?ref=" + appwriteSHA: "open-api3-1.7.x-client.json open-api3-1.7.x-server.json swagger2-1.7.x-server.json", + }, map[string]string{"/" + appwriteSHA + "/specs/1.7.x/open-api3-1.7.x-server.json": doc}) + spec, err := a.Fetch(context.Background(), "1.7.x@"+appwriteSHA) + if err != nil { + t.Fatal(err) + } + if spec.Version != "1.7.4" || string(spec.Content) != doc { + t.Errorf("version %q, content %s", spec.Version, spec.Content) + } +} + +func TestAppwriteFetchFailures(t *testing.T) { + listings := map[string]string{ + "specs?ref=" + appwriteSHA: "1.9.x latest", + "specs/1.9.x?ref=" + appwriteSHA: "open-api3-1.9.x-client.json", + "specs/1.8.x?ref=" + appwriteSHA: "open-api3-1.8.x-server.json", + "specs/1.6.x?ref=" + appwriteSHA: "open-api3-1.6.x-server.json", + } + raw := map[string]string{ + "/" + appwriteSHA + "/specs/1.8.x/open-api3-1.8.x-server.json": `{"info":{}}`, + "/" + appwriteSHA + "/specs/1.6.x/open-api3-1.6.x-server.json": ``, + } + a := fakeAppwriteGitHub(t, "", listings, raw) + for name, tag := range map[string]string{ + "short sha": "06e6fafa", + "bad directory": "latest@" + appwriteSHA, + "no server document": appwriteSHA, + "no info.version": "1.8.x@" + appwriteSHA, + "invalid json": "1.6.x@" + appwriteSHA, + "unknown commit": strings.Repeat("0", 40), + } { + if _, err := a.Fetch(context.Background(), tag); err == nil { + t.Errorf("%s: want an error", name) + } + } + if newestAppwriteDir([]string{"latest", "README.md"}) != "" { + t.Error("no minor directory: want none") + } +} diff --git a/diff/diff.go b/diff/diff.go index a10bcda..c012569 100644 --- a/diff/diff.go +++ b/diff/diff.go @@ -120,13 +120,53 @@ type Options struct { // `deprecated` comes before `description` and survives the 2,000-character // cut (only a `callbacks` key would sort ahead of it). QuoteDeprecatedOperation bool + + // QuoteDeprecated is a JSON pointer, relative to the operation, to the + // node a deprecation by the flag cites instead of the bare `true` or the + // whole operation: for a spec that says why in an extension of its own + // (Appwrite's "/x-appwrite/deprecated", {"since", "replaceWith"}), which + // would sort last in the whole operation and be lost to the + // 2,000-character cut. "" (the zero value), or an operation without that + // node, cites as before. + QuoteDeprecated string + + // FlagNotDeprecation reports whether an operation's `deprecated` flag + // is not about the operation itself, for a spec that sets the flag for + // something narrower (Appwrite flags an operation when one of its SDK + // method names is renamed and the route stays). Such an operation reads + // as not deprecated by the flag, before and after, so it becoming + // deprecated for real later is still a change. Nil believes every flag. + FlagNotDeprecation func(op map[string]any) bool } // OperationDeprecated reports whether an operation object is marked -// deprecated, by its flag or, when DeprecatedSummary or DeprecatedDescription -// is set, its summary or description. +// deprecated, by its flag (unless FlagNotDeprecation says it isn't about the +// operation) or, when DeprecatedSummary or DeprecatedDescription is set, its +// summary or description. func (o Options) OperationDeprecated(op map[string]any) bool { - return truthy(op["deprecated"]) || o.summaryDeprecated(op) || o.descriptionDeprecated(op) + return o.flagDeprecated(op) || o.summaryDeprecated(op) || o.descriptionDeprecated(op) +} + +func (o Options) flagDeprecated(op map[string]any) bool { + return truthy(op["deprecated"]) && (o.FlagNotDeprecation == nil || !o.FlagNotDeprecation(op)) +} + +// quoted is the node QuoteDeprecated points at in op, if it's set and there. +func (o Options) quoted(op map[string]any) (any, bool) { + if o.QuoteDeprecated == "" || !strings.HasPrefix(o.QuoteDeprecated, "/") { + return nil, false + } + var node any = op + for _, tok := range strings.Split(o.QuoteDeprecated[1:], "/") { + m, ok := node.(map[string]any) + if !ok { + return nil, false + } + if node, ok = m[unescape(tok)]; !ok { + return nil, false + } + } + return node, true } func (o Options) descriptionDeprecated(op map[string]any) bool { @@ -302,10 +342,15 @@ func (d *differ) paths(oldPaths, newPaths map[string]any) { d.add(w, OperationRemoved, "", true, oldOp) default: if !d.opts.OperationDeprecated(oldOp) && d.opts.OperationDeprecated(newOp) { + quoted, hasQuoted := d.opts.quoted(newOp) switch { - case truthy(newOp["deprecated"]) && d.opts.QuoteDeprecatedOperation: + case d.opts.flagDeprecated(newOp) && hasQuoted: + qw := w + qw.ptrNew += d.opts.QuoteDeprecated + d.add(qw, OperationDeprecated, "", false, quoted) + case d.opts.flagDeprecated(newOp) && d.opts.QuoteDeprecatedOperation: d.add(w, OperationDeprecated, "", false, newOp) - case truthy(newOp["deprecated"]): + case d.opts.flagDeprecated(newOp): d.add(w.child("deprecated"), OperationDeprecated, "", false, newOp["deprecated"]) case d.opts.summaryDeprecated(newOp): // Said in words: the summary is the evidence. @@ -759,3 +804,8 @@ func joinProp(prefix, name string) string { func escape(token string) string { return strings.NewReplacer("~", "~0", "/", "~1").Replace(token) } + +// unescape decodes a JSON Pointer token per RFC 6901. +func unescape(token string) string { + return strings.NewReplacer("~1", "/", "~0", "~").Replace(token) +} diff --git a/diff/options_test.go b/diff/options_test.go index bc73990..9247642 100644 --- a/diff/options_test.go +++ b/diff/options_test.go @@ -198,3 +198,47 @@ func TestOperationDeprecatedByDescription(t *testing.T) { t.Error("zero Options reads the description") } } + +// With QuoteDeprecated, a deprecation by the flag cites the node it points at +// under the operation; an operation without that node cites as before. +func TestQuoteDeprecated(t *testing.T) { + plain := mustParse(t, pathsSpec(`"/t":{"post":{"description":"Create."},"get":{}}`)) + newSpec := mustParse(t, pathsSpec(`"/t":{"post":{"deprecated":true,"description":"Create.","x-v":{"deprecated":{"since":"1.8.0","replaceWith":"tables.create"}}},"get":{"deprecated":true}}`)) + got := ChangesWith(plain, newSpec, Options{QuoteDeprecated: "/x-v/deprecated", QuoteDeprecatedOperation: true}) + if len(got) != 2 { + t.Fatalf("got %v, want two deprecations", kinds(got)) + } + byOp := map[string]Change{} + for _, c := range got { + byOp[c.Operation] = c + } + post := byOp["POST /t"] + if q, _ := post.Node.(map[string]any); post.Pointer != "/paths/~1t/post/x-v/deprecated" || q["replaceWith"] != "tables.create" { + t.Errorf("POST: %+v, want the extension cited", post) + } + if get := byOp["GET /t"]; get.Pointer != "/paths/~1t/get" { + t.Errorf("GET, without the node: %+v, want the whole operation cited", get) + } +} + +// With FlagNotDeprecation, a flag it rejects isn't a deprecation, and an +// operation flagged that way that becomes deprecated for real is one then. +func TestFlagNotDeprecation(t *testing.T) { + plain := mustParse(t, pathsSpec(`"/a":{"get":{}}`)) + renamed := mustParse(t, pathsSpec(`"/a":{"get":{"deprecated":true,"x-why":"renamed"}}`)) + real := mustParse(t, pathsSpec(`"/a":{"get":{"deprecated":true,"x-why":"gone"}}`)) + opts := Options{FlagNotDeprecation: func(op map[string]any) bool { return op["x-why"] == "renamed" }} + if got := ChangesWith(plain, renamed, opts); len(got) != 0 { + t.Errorf("rejected flag: %v, want nothing", kinds(got)) + } + if got := ChangesWith(plain, renamed, Options{}); len(got) != 1 { + t.Errorf("without the option: %v, want the deprecation", kinds(got)) + } + got := ChangesWith(renamed, real, opts) + if len(got) != 1 || got[0].Kind != OperationDeprecated || got[0].Pointer != "/paths/~1a/get/deprecated" { + t.Errorf("rejected then real: %+v, want one deprecation", got) + } + if opts.OperationDeprecated(map[string]any{"deprecated": true, "x-why": "renamed"}) { + t.Error("OperationDeprecated believes a rejected flag") + } +} diff --git a/docs/plugins.json b/docs/plugins.json index a54ff56..659a08a 100644 --- a/docs/plugins.json +++ b/docs/plugins.json @@ -1,7 +1,7 @@ { "_comment": "Generated from the plugin registry and docs/plugins.md by `make plugins-json` (go run ./cmd/list-plugins). Don't edit by hand.", "$schema": "./plugins.schema.json", - "count": 24, + "count": 25, "plugins": [ { "id": "algolia-ingestion", @@ -53,6 +53,16 @@ "status": "live", "provider_page": "providers/anthropic-models.md" }, + { + "id": "appwrite", + "provider": "Appwrite", + "layer": "api", + "watches": "REST API operations a server SDK calls that are deprecated between commits of the spec, SDK method renames left out", + "format": "openapi", + "source_url": "https://github.com/appwrite/specs", + "status": "live", + "provider_page": "providers/appwrite.md" + }, { "id": "cloudflare", "provider": "Cloudflare", diff --git a/docs/plugins.md b/docs/plugins.md index 5797161..b200992 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -33,6 +33,7 @@ The table between the `plugins:start` and `plugins:end` markers is also publishe | [`cloudflare`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/cloudflare.md) | Cloudflare | API | REST API operations Cloudflare deprecates, breaking on their end-of-life date when it gives one | `feed` | [Cloudflare API deprecations (RSS)](https://developers.cloudflare.com/fundamentals/api/reference/deprecations/index.xml) | live | | [`posthog`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/posthog.md) | PostHog | SDK | Members removed in the posthog Python SDK 8.0.0 | `removedmembers` | [posthog-python 7.x to 8.0 migration guide](https://github.com/PostHog/posthog-python/blob/posthog-v8.0.0/docs/migration-7.x-to-8.0.md) | live | | [`newrelic`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/newrelic.md) | New Relic | SDK | Members removed in the New Relic Python agent 11.0.0 | `removedmembers` | [Python agent 11.0.0 release notes](https://github.com/newrelic/docs-website/blob/f0b4f817bf9a7b76a78e26609369a8a7ce764c8e/src/content/docs/release-notes/agent-release-notes/python-release-notes/python-agent-110000.mdx) | live | +| [`appwrite`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/appwrite.md) | Appwrite | API | REST API operations a server SDK calls that are deprecated between commits of the spec, SDK method renames left out | `openapi` | [appwrite/specs](https://github.com/appwrite/specs) (`specs/.x/open-api3-.x.json`, the newest minor) | live | ## The columns diff --git a/plugins/openapi/appwrite.go b/plugins/openapi/appwrite.go new file mode 100644 index 0000000..0dc42a2 --- /dev/null +++ b/plugins/openapi/appwrite.go @@ -0,0 +1,67 @@ +package openapi + +import "github.com/patch-it-dev/patch-it-plugins/diff" + +// appwriteDiff is how Appwrite's spec says what it says: +// +// - A deprecation is the `deprecated` flag plus x-appwrite.deprecated, +// {"since": "1.8.0", "replaceWith": "tablesDB.createTransaction"}: the +// only place the spec says what to use instead (the description doesn't). +// x-appwrite sorts last in the operation, after parameters and +// responses, so quoting the whole operation can lose it to the +// 2,000-character cut: the event quotes x-appwrite.deprecated itself. +// The flag without it is quoted as the flag (never seen so far). +// - The flag also marks an operation one of whose SDK method names was +// renamed: POST /account/mfa/challenges is flagged with "replaceWith": +// "account.createMFAChallenge", which is the same operation's other +// name in x-appwrite.methods (createMfaChallenge became +// createMFAChallenge). The route isn't deprecated, so that flag isn't +// read as a deprecation: see appwriteMethodRename. +// - Path parameters are matched by place, as for the other specs. +var appwriteDiff = diff.Options{ + PathTemplates: true, + QuoteDeprecated: "/x-appwrite/deprecated", + FlagNotDeprecation: appwriteMethodRename, +} + +// appwriteMethodRename reports whether an operation's deprecation is the +// rename of one of its SDK methods: x-appwrite.deprecated.replaceWith names +// a method of the same operation's x-appwrite.methods +// ("."). 23 of the 99 operations flagged in 2.7.x's server +// operations are, all flagged since 1.8.0 (1.8.x's server document at +// ac705cd3 has the same 23). +func appwriteMethodRename(op map[string]any) bool { + xa, _ := op["x-appwrite"].(map[string]any) + dep, _ := xa["deprecated"].(map[string]any) + replaceWith, _ := dep["replaceWith"].(string) + if replaceWith == "" { + return false + } + methods, _ := xa["methods"].([]any) + for _, m := range methods { + method, _ := m.(map[string]any) + namespace, _ := method["namespace"].(string) + name, _ := method["name"].(string) + if name != "" && namespace+"."+name == replaceWith { + return true + } + } + return false +} + +// appwriteKeep keeps operation deprecations only: not even a deprecated +// operation's removal. Read as Fetch reads it (the newest minor's server +// operations at each of the 139 commits on appwrite/specs' main, 2026-02-17 +// to 2026-11-17), the spec's history has 14 deprecations, all on +// 2026-06-24 (see the golden test), and 78 operations leaving it (from the spec, or from the server +// platform), only one +// marked deprecated first, and that one a path move: PATCH +// /databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship +// became .../attributes/relationship/{key} on 2026-03-20. Of the others, 13 +// are back in the spec now: 2.4.x's single document took the server platform +// off them on 2026-10-12 as not yet in a released SDK, and 2.5.x had them +// on it again the next day. Nothing in the spec says when an operation stops answering, so a +// removal isn't an event. +// +// Property changes and new operations are dropped too, as for vercel. +func appwriteKeep(c diff.Change) bool { return c.Kind == diff.OperationDeprecated } diff --git a/plugins/openapi/appwrite_test.go b/plugins/openapi/appwrite_test.go new file mode 100644 index 0000000..ea94c7b --- /dev/null +++ b/plugins/openapi/appwrite_test.go @@ -0,0 +1,206 @@ +package openapi + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/patch-it-dev/patch-it-plugins/adapter" + "github.com/patch-it-dev/patch-it-plugins/diff" + "github.com/patch-it-dev/patch-it-plugins/event" + "github.com/patch-it-dev/patch-it-plugins/kit/kittest" +) + +// The appwrite/specs commits the tests read (checked 2026-11-19). +const ( + appwrite19Old = "8c00ba356b01d43fbc6c88c60fb2a4fc99e04b40" // 2026-06-19 + appwrite19New = "7d74bf9f3c0c990745e822f5935bcfaca310fd06" // 2026-06-24 + appwrite24Old = "98cc1a25215d3cead3a64f9bd4574a9c5b1ec87b" // 2026-10-08 + appwrite24New = "06e6fafa4d1ae3c815843ff0b02a56e6e5582756" // 2026-10-12 + appwrite18 = "ac705cd3e9d5e3a0693b7e40189eb1e66883e341" // 2026-02-18 +) + +// What GitHub lists in specs/ at each commit, as it did on 2026-11-19. +var ( + appwriteDirsTo19 = "0.10.x 0.11.x 0.12.x 0.13.x 0.14.x 0.15.x 0.6.x 0.7.x 0.8.x 0.9.x 1.0.x 1.1.x 1.2.x 1.3.x 1.4.x 1.5.x 1.6.x 1.7.x 1.8.x 1.9.x latest" + appwriteDirs = map[string]string{ + appwrite19Old: appwriteDirsTo19, + appwrite19New: appwriteDirsTo19, + appwrite24Old: strings.Replace(appwriteDirsTo19, " latest", " 2.0.x 2.1.x 2.2.x 2.3.x 2.4.x latest", 1), + appwrite24New: strings.Replace(appwriteDirsTo19, " latest", " 2.0.x 2.1.x 2.2.x 2.3.x 2.4.x latest", 1), + appwrite18: strings.Replace(appwriteDirsTo19, " 1.9.x", "", 1), + } + // And in specs/.x: commit/dir -> file names -> the saved copy of + // the one the adapter reads (trimmed: see testdata/README.md). + appwriteFiles = map[string]map[string]string{ + appwrite19Old + "/1.9.x": {"open-api3-1.9.x-client.json": "", "open-api3-1.9.x-console.json": "", "open-api3-1.9.x-server.json": "testdata/appwrite-1.9.x-8c00ba35-server.json"}, + appwrite19New + "/1.9.x": {"open-api3-1.9.x-client.json": "", "open-api3-1.9.x-console.json": "", "open-api3-1.9.x-server.json": "testdata/appwrite-1.9.x-7d74bf9f-server.json"}, + appwrite24Old + "/2.4.x": {"open-api3-2.4.x-client.json": "", "open-api3-2.4.x-console.json": "", "open-api3-2.4.x-server.json": "", "open-api3-2.4.x.json": "testdata/appwrite-2.4.x-98cc1a25.json"}, + appwrite24New + "/2.4.x": {"open-api3-2.4.x-client.json": "", "open-api3-2.4.x-console.json": "", "open-api3-2.4.x-server.json": "", "open-api3-2.4.x.json": "testdata/appwrite-2.4.x-06e6fafa.json"}, + appwrite18 + "/1.7.x": {"open-api3-1.7.x-client.json": "", "open-api3-1.7.x-console.json": "", "open-api3-1.7.x-server.json": "testdata/appwrite-1.7.x-ac705cd3-server.json", "swagger2-1.7.x-server.json": ""}, + appwrite18 + "/1.8.x": {"open-api3-1.8.x-client.json": "", "open-api3-1.8.x-console.json": "", "open-api3-1.8.x-server.json": "testdata/appwrite-1.8.x-ac705cd3-server.json", "swagger2-1.8.x-server.json": ""}, + } +) + +// appwritePlugin is the plugin as registered, its adapter reading GitHub's +// listings and the saved copies from a local server. It returns the base of +// the raw URLs: //specs//. +func appwritePlugin(t *testing.T) (Plugin, string) { + t.Helper() + const repo = "/api/repos/appwrite/specs" + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + p, ref := r.URL.Path, r.URL.Query().Get("ref") + var names []string + switch { + case p == repo+"/contents/specs" && appwriteDirs[ref] != "": + names = strings.Fields(appwriteDirs[ref]) + case strings.HasPrefix(p, repo+"/contents/specs/") && appwriteFiles[ref+"/"+strings.TrimPrefix(p, repo+"/contents/specs/")] != nil: + for name := range appwriteFiles[ref+"/"+strings.TrimPrefix(p, repo+"/contents/specs/")] { + names = append(names, name) + } + default: + if rest, ok := strings.CutPrefix(p, "/raw/appwrite/specs/"); ok { + sha, path, _ := strings.Cut(rest, "/specs/") + dir, file, _ := strings.Cut(path, "/") + if saved := appwriteFiles[sha+"/"+dir][file]; saved != "" { + http.ServeFile(w, r, saved) + return + } + } + http.NotFound(w, r) + return + } + entries := make([]map[string]string, 0, len(names)) + for _, n := range names { + entries = append(entries, map[string]string{"name": n}) + } + json.NewEncoder(w).Encode(entries) + })) + t.Cleanup(srv.Close) + a := adapter.Appwrite{APIBase: srv.URL + "/api", RawBase: srv.URL + "/raw"} + return Plugin{Adapter: a, Diff: appwriteDiff, Keep: appwriteKeep}, srv.URL + "/raw/appwrite/specs" +} + +func replayAppwrite(t *testing.T, p Plugin, from, to string) []event.EventV2 { + t.Helper() + s := openStore(t) + if rejected, err := kittest.Replay(context.Background(), vercelEnv(s), s, p, from, to); err != nil || rejected { + t.Fatalf("replay %s -> %s: rejected=%v err=%v", from, to, rejected, err) + } + return kittest.Stored(t, s) +} + +func TestAppwriteRegistersItself(t *testing.T) { + kittest.Registered(t, Plugin{Adapter: adapter.Appwrite{}, Diff: appwriteDiff, Keep: appwriteKeep}) +} + +// The golden test: the only deprecations in the spec's history as the +// plugin reads it. On 2026-06-24 (7d74bf9f, still info.version 1.9.5) the +// 1.9.x server spec flagged 14 more operations, 83 to 97: the six +// /databases/transactions operations and the longtext, mediumtext, text and +// varchar attribute operations of the legacy Databases API, each "since" +// 1.8.0 and replaced with a TablesDB method. None is an SDK method rename, +// so the filter keeps all 14. Each event quotes x-appwrite.deprecated. +func TestAppwriteGolden(t *testing.T) { + p, base := appwritePlugin(t) + events := replayAppwrite(t, p, appwrite19Old, appwrite19New) + if len(events) != 14 { + t.Fatalf("%d events, want 14", len(events)) + } + file := appwriteFiles[appwrite19New+"/1.9.x"]["open-api3-1.9.x-server.json"] + url := base + "/" + appwrite19New + "/specs/1.9.x/open-api3-1.9.x-server.json" + for _, e := range events { + if e.ChangeType != event.ChangeTypeDeprecation || e.Breaking || e.Version != "1.9.5" || e.SourceURL != url { + t.Errorf("%s: %s %s from %s", e.Subject.Operation, e.ChangeType, e.Version, e.SourceURL) + } + if !strings.HasSuffix(e.SourcePointer, "/x-appwrite/deprecated") || jsonNode(t, file, e.SourcePointer) != e.SourceExcerpt { + t.Errorf("%s: excerpt %s doesn't match %s", e.Subject.Operation, e.SourceExcerpt, e.SourcePointer) + } + if !strings.Contains(e.SourceExcerpt, `"replaceWith":"tablesDB.`) || !strings.Contains(e.SourceExcerpt, `"since":"1.8.0"`) { + t.Errorf("%s: excerpt %s", e.Subject.Operation, e.SourceExcerpt) + } + } + for i := range events { + events[i].SourceURL = strings.Replace(events[i].SourceURL, base, "https://raw.githubusercontent.com/appwrite/specs", 1) + } + kittest.Golden(t, "testdata/golden/appwrite.json", events) +} + +// The pinned drop test. On 2026-10-12 (06e6fafa) 13 operations of 2.4.x's +// single document lost the server platform (still listed for console or +// client), none marked deprecated: it "listed server and client methods no +// released SDK ships yet". 2.5.x had all 13 on the server again the next +// day. As the adapter reads it, 13 removals; no event: removals never are. +func TestAppwriteDropsRemovals(t *testing.T) { + p, _ := appwritePlugin(t) + if events := replayAppwrite(t, p, appwrite24Old, appwrite24New); len(events) != 0 { + t.Fatalf("%d events, want none: %s", len(events), events[0].Subject.Operation) + } + // Unfiltered, the same pair reports the 13 removals. + p.Keep = nil + var removed int + for _, e := range replayAppwrite(t, p, appwrite24Old, appwrite24New) { + if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.AffectedKindOperation { + removed++ + } + } + if removed != 13 { + t.Errorf("unfiltered: %d removals, want 13", removed) + } + if c := (diff.Change{Kind: diff.OperationRemoved, Node: map[string]any{"deprecated": true}}); appwriteKeep(c) { + t.Error("appwriteKeep keeps a removal of a deprecated operation") + } +} + +// From 1.7.x to 1.8.x (both at ac705cd3), 21 server operations were flagged +// deprecated only because an SDK method name was renamed +// (createMfaChallenge to createMFAChallenge, createSms to createSMS, ...): +// replaceWith is the same operation's other name, and the route stays. The +// saved copies keep only those 21 operations' paths. No event; reading every +// flag, 21. +func TestAppwriteDropsSDKMethodRenames(t *testing.T) { + p, _ := appwritePlugin(t) + if events := replayAppwrite(t, p, "1.7.x@"+appwrite18, appwrite18); len(events) != 0 { + t.Fatalf("%d events, want none: %s", len(events), events[0].Subject.Operation) + } + p.Diff.FlagNotDeprecation = nil + events := replayAppwrite(t, p, "1.7.x@"+appwrite18, appwrite18) + if len(events) != 21 { + t.Fatalf("every flag read: %d events, want 21", len(events)) + } + for _, e := range events { + if e.Version != "1.8.1" || e.PreviousVersion != "1.7.4" { + t.Errorf("%s: %s -> %s", e.Subject.Operation, e.PreviousVersion, e.Version) + } + } +} + +func TestAppwriteMethodRename(t *testing.T) { + methods := []any{ + map[string]any{"namespace": "account", "name": "createMfaChallenge"}, + map[string]any{"namespace": "account", "name": "createMFAChallenge"}, + } + for name, c := range map[string]struct { + replaceWith string + want bool + }{ + "same operation's other name": {"account.createMFAChallenge", true}, + "another operation": {"tablesDB.createTransaction", false}, + "name in another namespace": {"users.createMFAChallenge", false}, + "no replacement": {"", false}, + } { + op := map[string]any{"deprecated": true, "x-appwrite": map[string]any{ + "deprecated": map[string]any{"since": "1.8.0", "replaceWith": c.replaceWith}, + "methods": methods, + }} + if got := appwriteMethodRename(op); got != c.want { + t.Errorf("%s: got %v, want %v", name, got, c.want) + } + } + if appwriteMethodRename(map[string]any{"deprecated": true}) { + t.Error("an operation without x-appwrite reads as a rename") + } +} diff --git a/plugins/openapi/openapi.go b/plugins/openapi/openapi.go index 2ff5f48..848794a 100644 --- a/plugins/openapi/openapi.go +++ b/plugins/openapi/openapi.go @@ -49,6 +49,10 @@ func init() { // Operation deprecations only, most said in the description: see // sentry.go. plugin.Register(Plugin{Adapter: adapter.Sentry{}, Diff: sentryDiff, Keep: sentryKeep}) + // No Hints: Appwrite's changelog is product news, not keyed by operation. + // Operation deprecations only, SDK method renames left out: see + // appwrite.go. + plugin.Register(Plugin{Adapter: adapter.Appwrite{}, Diff: appwriteDiff, Keep: appwriteKeep}) } // requestSide keeps the changes to what callers send. GitLab's response diff --git a/plugins/openapi/testdata/README.md b/plugins/openapi/testdata/README.md index 64df17c..64c7707 100644 --- a/plugins/openapi/testdata/README.md +++ b/plugins/openapi/testdata/README.md @@ -28,6 +28,9 @@ Each pair is a real breaking change between two releases of a provider's own spe | `sentry-2.0.1.json`, `sentry-2.1.0.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/2.0.1/openapi-derefed.json (and `2.1.0`) | 2026-11-19 | FSL-1.1-Apache-2.0 (getsentry/sentry-api-schema; the spec's own `info.license` says Apache 2.0) | `"url": "https://{region}.sentry.io"` and `"/api/0/organizations/": {` (in `2.0.1`), `"url": "https://{region}.sentry.io/api/0"` and `"/organizations/": {` (in `2.1.0`): the drop test | | `sentry-94bc6e59.json`, `sentry-d15557ff.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/94bc6e593eaf8a3800341abd429d2949895926fd/openapi-derefed.json (and `d15557ff7472748887043ab8a72687b20214a9bd`) | 2026-11-19 | Apache 2.0 (the spec's own `info.license`; getsentry/sentry-api-schema had no license file before 2026-02-10) | "**Eventsv2 Deprecation Note**: Users who may be using the `eventsv2` endpoint should update their requests to the `events` endpoint" (`GET .../events/`, new in `d15557ff`; not a deprecation of it) | | `sentry-e8ec23b4.json`, `sentry-1ef7f21a.json` | https://raw.githubusercontent.com/getsentry/sentry-api-schema/e8ec23b4c9601dea2d51205983ec1d7b89550b85/openapi-derefed.json (and `1ef7f21a0501fae9490d69e3ae29f0d5acbfb61c`) | 2026-11-19 | FSL-1.1-Apache-2.0 (getsentry/sentry-api-schema; the spec's own `info.license` says Apache 2.0) | "a brief description, examples, and deprecation details." (`GET .../trace-items/attributes/`, new in `1ef7f21a`; not a deprecation) | +| `appwrite-1.9.x-8c00ba35-server.json`, `appwrite-1.9.x-7d74bf9f-server.json` | https://raw.githubusercontent.com/appwrite/specs/8c00ba356b01d43fbc6c88c60fb2a4fc99e04b40/specs/1.9.x/open-api3-1.9.x-server.json (and `7d74bf9f3c0c990745e822f5935bcfaca310fd06`) | 2026-11-19 | BSD-3-Clause (appwrite/specs) | `"replaceWith": "tablesDB.createTransaction"` (`x-appwrite.deprecated` of `POST /databases/transactions`, flagged in `7d74bf9f` with 13 more) | +| `appwrite-2.4.x-98cc1a25.json`, `appwrite-2.4.x-06e6fafa.json` | https://raw.githubusercontent.com/appwrite/specs/98cc1a25215d3cead3a64f9bd4574a9c5b1ec87b/specs/2.4.x/open-api3-2.4.x.json (and `06e6fafa4d1ae3c815843ff0b02a56e6e5582756`) | 2026-11-19 | BSD-3-Clause (appwrite/specs) | `"server"` in `x-appwrite.platforms` of `POST /account/recovery/otp` and 12 more operations (in `98cc1a25`, none deprecated; off them in `06e6fafa`, on again in 2.5.x the next day): the drop test | +| `appwrite-1.7.x-ac705cd3-server.json`, `appwrite-1.8.x-ac705cd3-server.json` | https://raw.githubusercontent.com/appwrite/specs/ac705cd3e9d5e3a0693b7e40189eb1e66883e341/specs/1.7.x/open-api3-1.7.x-server.json (and `specs/1.8.x/open-api3-1.8.x-server.json` at the same commit) | 2026-11-19 | BSD-3-Clause (appwrite/specs) | `"replaceWith": "account.createMFAAuthenticator"` on `POST /account/mfa/authenticators/{type}`, whose `x-appwrite.methods` are `createMfaAuthenticator` and `createMFAAuthenticator` (one of 21 SDK method renames flagged in 1.8.x) | The Elasticsearch copies keep `openapi`, `info` and the paths involved, every line unchanged; the 9.2 copy's paths are all gone in 9.2, so its `"paths": {}` is the one line that isn't in the original. @@ -37,4 +40,6 @@ The Supabase copies keep each value unchanged but are re-indented: the source is The Sentry copies keep `openapi`, `info`, `servers` and the path items involved, whole, in their original order except that `servers` comes before `paths`, every line copied unchanged (bar the trailing comma after a path item that's now last); `components` and `tags` left out. Each pair gives the same events as the full files, with the filter and with the variants the tests use (flag only, "deprecat" anywhere). The tests serve them as GitHub would, with each commit's date and each tag's release date. +The Appwrite copies keep `openapi`, `info`, `servers` and the path items involved, whole and in their original order; `tags`, `components` and `externalDocs` left out. They're re-serialized the way the originals are written (4-space indent, `/` written `\/`, non-ASCII as `\u` escapes), which gives every original line back byte for byte when nothing is left out, so every kept line is unchanged bar a trailing comma. The 1.9.x pair keeps the paths of the 14 operations deprecated in `7d74bf9f`, the 2.4.x pair the paths of the 13 operations that lost the server platform in `06e6fafa`, the 1.7.x and 1.8.x pair the paths of the 21 operations flagged only for an SDK method rename. With the full files the plugin gives the same results: 14 events, none, and none (50, from the rest of 1.8.x's Databases deprecations, with the 21 renames still left out). + Stripe's spec isn't saved here: its tests use small specs written inline. diff --git a/plugins/openapi/testdata/appwrite-1.7.x-ac705cd3-server.json b/plugins/openapi/testdata/appwrite-1.7.x-ac705cd3-server.json new file mode 100644 index 0000000..e2374fe --- /dev/null +++ b/plugins/openapi/testdata/appwrite-1.7.x-ac705cd3-server.json @@ -0,0 +1,1745 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.7.4", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1" + }, + { + "url": "https:\/\/.cloud.appwrite.io\/v1" + } + ], + "paths": { + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 360, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "x-example": "" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 367, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 333, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 346, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 332, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 345, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 326, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 339, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 266, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 271, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 267, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 268, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 270, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 269, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + } + } +} \ No newline at end of file diff --git a/plugins/openapi/testdata/appwrite-1.8.x-ac705cd3-server.json b/plugins/openapi/testdata/appwrite-1.8.x-ac705cd3-server.json new file mode 100644 index 0000000..ef16e28 --- /dev/null +++ b/plugins/openapi/testdata/appwrite-1.8.x-ac705cd3-server.json @@ -0,0 +1,3122 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.8.1", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1" + }, + { + "url": "https:\/\/.cloud.appwrite.io\/v1" + } + ], + "paths": { + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 241, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + }, + "methods": [ + { + "name": "createMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFAAuthenticator" + } + }, + { + "name": "createMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaType" + } + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "demo": "account\/create-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 242, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + }, + "methods": [ + { + "name": "updateMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFAAuthenticator" + } + }, + { + "name": "updateMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type", + "otp" + ], + "required": [ + "type", + "otp" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "demo": "account\/update-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 243, + "cookies": false, + "type": "", + "demo": "account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [ + "type" + ], + "required": [ + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator for a user by ID.", + "demo": "account\/delete-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 240, + "cookies": false, + "type": "", + "demo": "account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "account\/list-mfa-factors.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 246, + "cookies": false, + "type": "", + "demo": "account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "demo": "account\/get-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 244, + "cookies": false, + "type": "", + "demo": "account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "demo": "account\/create-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 245, + "cookies": false, + "type": "", + "demo": "account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "account.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "account", + "desc": "", + "auth": { + "Project": [], + "Session": [] + }, + "parameters": [], + "required": [], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "demo": "account\/update-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 229, + "cookies": false, + "type": "", + "demo": "messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + }, + "methods": [ + { + "name": "createSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMS" + } + }, + { + "name": "createSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "content", + "topics", + "users", + "targets", + "draft", + "scheduledAt" + ], + "required": [ + "messageId", + "content" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Create a new SMS message.", + "demo": "messaging\/create-sms.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "x-example": "" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "messageId", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 236, + "cookies": false, + "type": "", + "demo": "messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + }, + "methods": [ + { + "name": "updateSms", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMS" + } + }, + { + "name": "updateSMS", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "messageId", + "topics", + "users", + "targets", + "content", + "draft", + "scheduledAt" + ], + "required": [ + "messageId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/message" + } + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "demo": "messaging\/update-sms.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + }, + "x-nullable": true + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + }, + "x-nullable": true + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + }, + "x-nullable": true + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "", + "x-nullable": true + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false, + "x-nullable": true + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 201, + "cookies": false, + "type": "", + "demo": "messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + }, + "methods": [ + { + "name": "createApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createAPNSProvider" + } + }, + { + "name": "createAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Apple Push Notification service provider.", + "demo": "messaging\/create-apns-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 215, + "cookies": false, + "type": "", + "demo": "messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + }, + "methods": [ + { + "name": "updateApnsProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateAPNSProvider" + } + }, + { + "name": "updateAPNSProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "authKey", + "authKeyId", + "teamId", + "bundleId", + "sandbox" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "demo": "messaging\/update-apns-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false, + "x-nullable": true + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false, + "x-nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 200, + "cookies": false, + "type": "", + "demo": "messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + }, + "methods": [ + { + "name": "createFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createFCMProvider" + } + }, + { + "name": "createFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "serviceAccountJSON", + "enabled" + ], + "required": [ + "providerId", + "name" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "demo": "messaging\/create-fcm-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}", + "x-nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 214, + "cookies": false, + "type": "", + "demo": "messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + }, + "methods": [ + { + "name": "updateFcmProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateFCMProvider" + } + }, + { + "name": "updateFCMProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "enabled", + "serviceAccountJSON" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "demo": "messaging\/update-fcm-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false, + "x-nullable": true + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}", + "x-nullable": true + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 194, + "cookies": false, + "type": "", + "demo": "messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + }, + "methods": [ + { + "name": "createSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.createSMTPProvider" + } + }, + { + "name": "createSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId", + "name", + "host" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Create a new SMTP provider.", + "demo": "messaging\/create-smtp-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "x-example": 1, + "format": "int32" + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com", + "format": "email" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com", + "format": "email" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 208, + "cookies": false, + "type": "", + "demo": "messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + }, + "methods": [ + { + "name": "updateSmtpProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "messaging.updateSMTPProvider" + } + }, + { + "name": "updateSMTPProvider", + "namespace": "messaging", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "providerId", + "name", + "host", + "port", + "username", + "password", + "encryption", + "autoTLS", + "mailer", + "fromName", + "fromEmail", + "replyToName", + "replyToEmail", + "enabled" + ], + "required": [ + "providerId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/provider" + } + ], + "description": "Update a SMTP provider by its unique ID.", + "demo": "messaging\/update-smtp-provider.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false, + "x-nullable": true + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com", + "format": "email" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false, + "x-nullable": true + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 148, + "cookies": false, + "type": "", + "demo": "users\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + }, + "methods": [ + { + "name": "updateMfa", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFA" + } + }, + { + "name": "updateMFA", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "mfa" + ], + "required": [ + "userId", + "mfa" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/user" + } + ], + "description": "Enable or disable MFA on a user account.", + "demo": "users\/update-mfa.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 153, + "cookies": false, + "type": "", + "demo": "users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + }, + "methods": [ + { + "name": "deleteMfaAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.deleteMFAAuthenticator" + } + }, + { + "name": "deleteMFAAuthenticator", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId", + "type" + ], + "required": [ + "userId", + "type" + ], + "responses": [ + { + "code": 204 + } + ], + "description": "Delete an authenticator app.", + "demo": "users\/delete-mfa-authenticator.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 149, + "cookies": false, + "type": "", + "demo": "users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + }, + "methods": [ + { + "name": "listMfaFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.listMFAFactors" + } + }, + { + "name": "listMFAFactors", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaFactors" + } + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "demo": "users\/list-mfa-factors.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 150, + "cookies": false, + "type": "", + "demo": "users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + }, + "methods": [ + { + "name": "getMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.getMFARecoveryCodes" + } + }, + { + "name": "getMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/get-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 152, + "cookies": false, + "type": "", + "demo": "users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + }, + "methods": [ + { + "name": "updateMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.updateMFARecoveryCodes" + } + }, + { + "name": "updateMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 200, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "demo": "users\/update-mfa-recovery-codes.md", + "public": false + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 151, + "cookies": false, + "type": "", + "demo": "users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": false, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + }, + "methods": [ + { + "name": "createMfaRecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "public": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "users.createMFARecoveryCodes" + } + }, + { + "name": "createMFARecoveryCodes", + "namespace": "users", + "desc": "", + "auth": { + "Project": [], + "Key": [] + }, + "parameters": [ + "userId" + ], + "required": [ + "userId" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/mfaRecoveryCodes" + } + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "demo": "users\/create-mfa-recovery-codes.md", + "public": true + } + ], + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + } + } +} \ No newline at end of file diff --git a/plugins/openapi/testdata/appwrite-1.9.x-7d74bf9f-server.json b/plugins/openapi/testdata/appwrite-1.9.x-7d74bf9f-server.json new file mode 100644 index 0000000..c154395 --- /dev/null +++ b/plugins/openapi/testdata/appwrite-1.9.x-7d74bf9f-server.json @@ -0,0 +1,1461 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.9.5", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1", + "description": "Appwrite Cloud endpoint." + }, + { + "url": "https:\/\/{region}.cloud.appwrite.io\/v1", + "description": "Appwrite Cloud regional endpoint. Replace `{region}` with your project region.", + "variables": { + "region": { + "default": "fra", + "description": "Appwrite Cloud region." + } + } + } + ], + "paths": { + "\/databases\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "databasesListTransactions", + "tags": [ + "databases" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "listTransactions", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-transactions.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.listTransactions" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "databasesCreateTransaction", + "tags": [ + "databases" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createTransaction", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-transaction.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTransaction" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "type": "integer", + "description": "Seconds before the transaction expires.", + "default": 300, + "x-example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/databases\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "databasesGetTransaction", + "tags": [ + "databases" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "getTransaction", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-transaction.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.getTransaction" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "databasesUpdateTransaction", + "tags": [ + "databases" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateTransaction", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-transaction.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTransaction" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "type": "boolean", + "description": "Commit transaction?", + "default": false, + "x-example": false + }, + "rollback": { + "type": "boolean", + "description": "Rollback transaction?", + "default": false, + "x-example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "databasesDeleteTransaction", + "tags": [ + "databases" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": true, + "x-appwrite": { + "method": "deleteTransaction", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-transaction.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.deleteTransaction" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "databasesCreateOperations", + "tags": [ + "databases" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createOperations", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-operations.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createOperations" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "Array of staged operations.", + "default": [], + "x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"\",\n\t \"collectionId\": \"\",\n\t \"documentId\": \"\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]", + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/longtext": { + "post": { + "summary": "Create longtext attribute", + "operationId": "databasesCreateLongtextAttribute", + "tags": [ + "databases" + ], + "description": "Create a longtext attribute.\n", + "responses": { + "202": { + "description": "AttributeLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLongtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLongtextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/create-longtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-longtext-attribute.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLongtextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/longtext\/{key}": { + "patch": { + "summary": "Update longtext attribute", + "operationId": "databasesUpdateLongtextAttribute", + "tags": [ + "databases" + ], + "description": "Update a longtext attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLongtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLongtextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/update-longtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-longtext-attribute.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLongtextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/mediumtext": { + "post": { + "summary": "Create mediumtext attribute", + "operationId": "databasesCreateMediumtextAttribute", + "tags": [ + "databases" + ], + "description": "Create a mediumtext attribute.\n", + "responses": { + "202": { + "description": "AttributeMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeMediumtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createMediumtextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/create-mediumtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-mediumtext-attribute.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createMediumtextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/mediumtext\/{key}": { + "patch": { + "summary": "Update mediumtext attribute", + "operationId": "databasesUpdateMediumtextAttribute", + "tags": [ + "databases" + ], + "description": "Update a mediumtext attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeMediumtext" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateMediumtextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/update-mediumtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-mediumtext-attribute.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateMediumtextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/text": { + "post": { + "summary": "Create text attribute", + "operationId": "databasesCreateTextAttribute", + "tags": [ + "databases" + ], + "description": "Create a text attribute.\n", + "responses": { + "202": { + "description": "AttributeText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeText" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createTextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/create-text-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-text-attribute.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createTextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/text\/{key}": { + "patch": { + "summary": "Update text attribute", + "operationId": "databasesUpdateTextAttribute", + "tags": [ + "databases" + ], + "description": "Update a text attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeText" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateTextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/update-text-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-text-attribute.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateTextColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/varchar": { + "post": { + "summary": "Create varchar attribute", + "operationId": "databasesCreateVarcharAttribute", + "tags": [ + "databases" + ], + "description": "Create a varchar attribute.\n", + "responses": { + "202": { + "description": "AttributeVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeVarchar" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createVarcharAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/create-varchar-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-varchar-attribute.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createVarcharColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for varchar attributes, in number of characters. Maximum size is 16381.", + "x-example": 1, + "format": "int32" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/varchar\/{key}": { + "patch": { + "summary": "Update varchar attribute", + "operationId": "databasesUpdateVarcharAttribute", + "tags": [ + "databases" + ], + "description": "Update a varchar attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeVarchar" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateVarcharAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/update-varchar-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-varchar-attribute.md", + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateVarcharColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the varchar attribute.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/plugins/openapi/testdata/appwrite-1.9.x-8c00ba35-server.json b/plugins/openapi/testdata/appwrite-1.9.x-8c00ba35-server.json new file mode 100644 index 0000000..fb015d1 --- /dev/null +++ b/plugins/openapi/testdata/appwrite-1.9.x-8c00ba35-server.json @@ -0,0 +1,1405 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.9.5", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1", + "description": "Appwrite Cloud endpoint." + }, + { + "url": "https:\/\/{region}.cloud.appwrite.io\/v1", + "description": "Appwrite Cloud regional endpoint. Replace `{region}` with your project region.", + "variables": { + "region": { + "default": "fra", + "description": "Appwrite Cloud region." + } + } + } + ], + "paths": { + "\/databases\/transactions": { + "get": { + "summary": "List transactions", + "operationId": "databasesListTransactions", + "tags": [ + "databases" + ], + "description": "List transactions across all databases.", + "responses": { + "200": { + "description": "Transaction List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transactionList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "listTransactions", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/list-transactions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-transactions.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries).", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create transaction", + "operationId": "databasesCreateTransaction", + "tags": [ + "databases" + ], + "description": "Create a new transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTransaction", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/create-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-transaction.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "ttl": { + "type": "integer", + "description": "Seconds before the transaction expires.", + "default": 300, + "x-example": 60, + "format": "int32" + } + } + } + } + } + } + } + }, + "\/databases\/transactions\/{transactionId}": { + "get": { + "summary": "Get transaction", + "operationId": "databasesGetTransaction", + "tags": [ + "databases" + ], + "description": "Get a transaction by its unique ID.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "getTransaction", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/get-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rows.read", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-transaction.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update transaction", + "operationId": "databasesUpdateTransaction", + "tags": [ + "databases" + ], + "description": "Update a transaction, to either commit or roll back its operations.", + "responses": { + "200": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTransaction", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/update-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-transaction.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "commit": { + "type": "boolean", + "description": "Commit transaction?", + "default": false, + "x-example": false + }, + "rollback": { + "type": "boolean", + "description": "Rollback transaction?", + "default": false, + "x-example": false + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete transaction", + "operationId": "databasesDeleteTransaction", + "tags": [ + "databases" + ], + "description": "Delete a transaction by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "method": "deleteTransaction", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/delete-transaction.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-transaction.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/transactions\/{transactionId}\/operations": { + "post": { + "summary": "Create operations", + "operationId": "databasesCreateOperations", + "tags": [ + "databases" + ], + "description": "Create multiple operations in a single transaction.", + "responses": { + "201": { + "description": "Transaction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/transaction" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createOperations", + "group": "transactions", + "cookies": false, + "type": "", + "demo": "databases\/create-operations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-operations.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "transactionId", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "Array of staged operations.", + "default": [], + "x-example": "[\n\t {\n\t \"action\": \"create\",\n\t \"databaseId\": \"\",\n\t \"collectionId\": \"\",\n\t \"documentId\": \"\",\n\t \"data\": {\n\t \"name\": \"Walter O'Brien\"\n\t }\n\t }\n\t]", + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/longtext": { + "post": { + "summary": "Create longtext attribute", + "operationId": "databasesCreateLongtextAttribute", + "tags": [ + "databases" + ], + "description": "Create a longtext attribute.\n", + "responses": { + "202": { + "description": "AttributeLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLongtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLongtextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/create-longtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-longtext-attribute.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/longtext\/{key}": { + "patch": { + "summary": "Update longtext attribute", + "operationId": "databasesUpdateLongtextAttribute", + "tags": [ + "databases" + ], + "description": "Update a longtext attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeLongtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLongtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLongtextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/update-longtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-longtext-attribute.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/mediumtext": { + "post": { + "summary": "Create mediumtext attribute", + "operationId": "databasesCreateMediumtextAttribute", + "tags": [ + "databases" + ], + "description": "Create a mediumtext attribute.\n", + "responses": { + "202": { + "description": "AttributeMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeMediumtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createMediumtextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/create-mediumtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-mediumtext-attribute.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/mediumtext\/{key}": { + "patch": { + "summary": "Update mediumtext attribute", + "operationId": "databasesUpdateMediumtextAttribute", + "tags": [ + "databases" + ], + "description": "Update a mediumtext attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeMediumtext", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeMediumtext" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateMediumtextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/update-mediumtext-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-mediumtext-attribute.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/text": { + "post": { + "summary": "Create text attribute", + "operationId": "databasesCreateTextAttribute", + "tags": [ + "databases" + ], + "description": "Create a text attribute.\n", + "responses": { + "202": { + "description": "AttributeText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeText" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createTextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/create-text-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-text-attribute.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/text\/{key}": { + "patch": { + "summary": "Update text attribute", + "operationId": "databasesUpdateTextAttribute", + "tags": [ + "databases" + ], + "description": "Update a text attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeText", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeText" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateTextAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/update-text-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-text-attribute.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/varchar": { + "post": { + "summary": "Create varchar attribute", + "operationId": "databasesCreateVarcharAttribute", + "tags": [ + "databases" + ], + "description": "Create a varchar attribute.\n", + "responses": { + "202": { + "description": "AttributeVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeVarchar" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createVarcharAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/create-varchar-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-varchar-attribute.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for varchar attributes, in number of characters. Maximum size is 16381.", + "x-example": 1, + "format": "int32" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/varchar\/{key}": { + "patch": { + "summary": "Update varchar attribute", + "operationId": "databasesUpdateVarcharAttribute", + "tags": [ + "databases" + ], + "description": "Update a varchar attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeVarchar", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeVarchar" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateVarcharAttribute", + "group": "attributes", + "cookies": false, + "type": "", + "demo": "databases\/update-varchar-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-varchar-attribute.md", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the varchar attribute.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Attribute Key.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/plugins/openapi/testdata/appwrite-2.4.x-06e6fafa.json b/plugins/openapi/testdata/appwrite-2.4.x-06e6fafa.json new file mode 100644 index 0000000..d803c42 --- /dev/null +++ b/plugins/openapi/testdata/appwrite-2.4.x-06e6fafa.json @@ -0,0 +1,1317 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "2.4.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1", + "description": "Appwrite Cloud endpoint." + }, + { + "url": "https:\/\/{region}.cloud.appwrite.io\/v1", + "description": "Appwrite Cloud regional endpoint. Replace `{region}` with your project region.", + "variables": { + "region": { + "default": "fra", + "description": "Appwrite Cloud region." + } + } + } + ], + "paths": { + "\/account\/recovery\/otp": { + "post": { + "summary": "Create password recovery (OTP)", + "operationId": "accountCreateRecoveryOTP", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a 6-digit password recovery code to the user's email address. Unlike [createRecovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a recovery page. Learn more about how to [complete the recovery process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecoveryOTP). The code sent to the user's email address is valid for 15 minutes.\n\nEnable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/create-recovery-otp.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "email" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (OTP)", + "operationId": "accountUpdateRecoveryOTP", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated.\n", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/update-recovery-otp.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "" + }, + "secret": { + "description": "Valid recovery OTP code.", + "type": "string", + "example": "" + }, + "password": { + "description": "New user password. Must be between 8 and 256 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/id-token": { + "post": { + "summary": "Create ID token session", + "operationId": "accountCreateIdTokenSession", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider's published signing keys and a session is created in a single request.\n\nNative sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow's enabled setting, which has no effect on this endpoint. The token's audience must match the provider's configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app's bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them.\n\nPass the raw nonce used when requesting the ID token so it can be validated against the token's nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user's name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nThis flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Appwrite cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-id-token-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "provider": { + "description": "OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google.", + "type": "string", + "example": "apple", + "title": "IdTokenProvider", + "oneOf": [ + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + } + ] + }, + "idToken": { + "description": "OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple.", + "type": "string", + "example": "" + }, + "nonce": { + "description": "Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce.", + "type": "string", + "default": "", + "example": "" + }, + "accessToken": { + "description": "Provider access token to store alongside the session for calling provider APIs. Never used for authentication.", + "type": "string", + "default": "", + "example": "" + }, + "accessTokenExpiry": { + "description": "Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + }, + "name": { + "description": "User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization.", + "type": "string", + "default": "", + "example": "" + } + }, + "required": [ + "provider", + "idToken" + ] + } + } + } + } + } + }, + "\/account\/verifications\/email\/otp": { + "post": { + "summary": "Create email verification (OTP)", + "operationId": "accountCreateEmailVerificationOTP", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a 6-digit verification code to the currently logged in user's email address. Unlike [createEmailVerification](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailVerification), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmailVerificationOTP). The code sent to the user's email address is valid for 15 minutes.\n\nEnable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/create-email-verification-otp.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "put": { + "summary": "Update email verification (OTP)", + "operationId": "accountUpdateEmailVerificationOTP", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by [createEmailVerificationOTP](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailVerificationOTP). Pass the **userId** of the user being verified along with the **secret** code from the email. If confirmed, this route will return a 200 status code and the code is consumed.\n", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/update-email-verification-otp.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "console", + "client" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "" + }, + "secret": { + "description": "Valid verification OTP code.", + "type": "string", + "example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/photo": { + "get": { + "summary": "Get user photo", + "operationId": "avatarsGetPhoto", + "tags": [ + "avatars" + ], + "description": "Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: a custom uploaded photo (see avatars.updatePhoto), OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.\n\nPassing `userId` \u2014 `current()` for the authenticated user \u2014 resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and\/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-photo.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [], + "ImpersonateUserId": [] + }, + "client": { + "Project": [], + "ImpersonateUserId": [] + }, + "server": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + }, + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "width", + "description": "Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "height", + "description": "Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Output image quality between 0 and 100. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "output", + "description": "Output image format. Defaults to 'png'.", + "required": false, + "schema": { + "type": "string", + "example": "png", + "default": "png" + }, + "in": "query" + }, + { + "name": "rating", + "description": "Maximum image rating to fetch from Gravatar\/Libravatar. Defaults to 'g'.", + "required": false, + "schema": { + "type": "string", + "example": "g", + "default": "g" + }, + "in": "query" + }, + { + "name": "userId", + "description": "User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed.", + "required": false, + "schema": { + "type": "string", + "example": "current()", + "default": "" + }, + "in": "query" + }, + { + "name": "emailHash", + "description": "SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself.", + "required": false, + "schema": { + "type": "string", + "example": "", + "default": "" + }, + "in": "query" + }, + { + "name": "name", + "description": "Name to render initials from instead of the user's own name. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Update photo", + "operationId": "avatarsUpdatePhoto", + "tags": [ + "avatars" + ], + "description": "Update the profile photo of the currently authenticated user. The uploaded image takes priority over every other photo source, including OAuth2 identity photos, Gravatar, and Libravatar. Updating an already customized photo replaces it. The image must be at most 5MB and is sent in a single request.", + "responses": { + "200": { + "description": "Account", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/account" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/update-photo.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "avatars.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "description": "Binary image file of at most 5MB. Allowed file types are png, jpg, jpeg, and webp.", + "type": "string", + "format": "binary" + } + }, + "required": [ + "file" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete photo", + "operationId": "avatarsDeletePhoto", + "tags": [ + "avatars" + ], + "description": "Delete the profile photo of the currently authenticated user and store the built-in static placeholder in its place. The placeholder is the user's photo from then on, so it takes priority over every other photo source \u2014 OAuth2 identity photos, Gravatar, Libravatar, and initials \u2014 until a new photo is uploaded with avatars.updatePhoto.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/delete-photo.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "avatars.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/providers\/appwrite": { + "post": { + "summary": "Create Appwrite provider", + "operationId": "messagingCreateAppwriteProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Appwrite push provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-appwrite-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "" + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "qos": { + "description": "Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + }, + "expiry": { + "description": "Default message retention in seconds for offline delivery. Max 7 days (604800).", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/appwrite\/{providerId}": { + "patch": { + "summary": "Update Appwrite provider", + "operationId": "messagingUpdateAppwriteProvider", + "tags": [ + "messaging" + ], + "description": "Update an Appwrite push provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-appwrite-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "qos": { + "description": "Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + }, + "expiry": { + "description": "Default message retention in seconds for offline delivery. Max 7 days (604800).", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/kakao": { + "patch": { + "summary": "Update project OAuth2 Kakao", + "operationId": "projectUpdateOAuth2Kakao", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Kakao configuration.", + "responses": { + "200": { + "description": "OAuth2Kakao", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Kakao" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-kakao.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de", + "type": "string", + "example": "", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled", + "type": "string", + "example": "", + "nullable": true + }, + "prompt": { + "description": "Array of Kakao OAuth2 prompt values. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. \"login\" means: prompt the user to re-authenticate. \"create\" means: prompt the user to sign up. \"select_account\" means: prompt the user to select an account. Pass an empty array to use the Kakao default.", + "type": "array", + "items": { + "title": "ProjectOAuth2KakaoPrompt", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "login" + ], + "title": "login" + }, + { + "type": "string", + "enum": [ + "create" + ], + "title": "create" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/tiktok": { + "patch": { + "summary": "Update project OAuth2 TikTok", + "operationId": "projectUpdateOAuth2TikTok", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 TikTok configuration.", + "responses": { + "200": { + "description": "OAuth2TikTok", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2TikTok" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-tik-tok.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0", + "type": "string", + "example": "", + "nullable": true + }, + "clientSecret": { + "description": "'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite", + "type": "string", + "example": "", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/webflow": { + "patch": { + "summary": "Update project OAuth2 Webflow", + "operationId": "projectUpdateOAuth2Webflow", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Webflow configuration.", + "responses": { + "200": { + "description": "OAuth2Webflow", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Webflow" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-webflow.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd", + "type": "string", + "example": "", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Webflow OAuth2 app. For example: 59bf00000000000000000000000000000000000000000000000000000000fe59", + "type": "string", + "example": "", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/policies\/password-pwned": { + "patch": { + "summary": "Update password pwned policy", + "operationId": "projectUpdatePasswordPwnedPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if passwords are checked against the Have I Been Pwned breach database. When enabled, every password a user signs up, signs in or resets with is checked and the result is recorded on the user as `passwordPwned`. On its own the policy only records. Enable `users` to reject a breached password when a user signs up or sets a new password, and `sessions` to refuse a sign-in with a breached password until it is reset. Only the first five characters of the password hash are ever shared with the service. Options left out keep their current value.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-pwned-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle password pwned policy. Set to true to check passwords against known data breaches and record the result on the user, or false to never check. Default is true. On its own this only records; use `users` and `sessions` to block. When changing this policy, existing passwords remain valid.", + "type": "boolean", + "example": false + }, + "sessions": { + "description": "Whether a sign-in with a breached password is refused until the password is reset. Default is false, which allows the sign-in and only records the result.", + "type": "boolean", + "example": false + }, + "users": { + "description": "Whether a breached password is rejected when a user signs up or sets a new password. Default is false, which allows the password and only records the result.", + "type": "boolean", + "example": false + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/plugins/openapi/testdata/appwrite-2.4.x-98cc1a25.json b/plugins/openapi/testdata/appwrite-2.4.x-98cc1a25.json new file mode 100644 index 0000000..4b23776 --- /dev/null +++ b/plugins/openapi/testdata/appwrite-2.4.x-98cc1a25.json @@ -0,0 +1,1332 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "2.4.0", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", + "termsOfService": "https:\/\/appwrite.io\/policy\/terms", + "contact": { + "name": "Appwrite Team", + "url": "https:\/\/appwrite.io\/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1", + "description": "Appwrite Cloud endpoint." + }, + { + "url": "https:\/\/{region}.cloud.appwrite.io\/v1", + "description": "Appwrite Cloud regional endpoint. Replace `{region}` with your project region.", + "variables": { + "region": { + "default": "fra", + "description": "Appwrite Cloud region." + } + } + } + ], + "paths": { + "\/account\/recovery\/otp": { + "post": { + "summary": "Create password recovery (OTP)", + "operationId": "accountCreateRecoveryOTP", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a 6-digit password recovery code to the user's email address. Unlike [createRecovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a recovery page. Learn more about how to [complete the recovery process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecoveryOTP). The code sent to the user's email address is valid for 15 minutes.\n\nEnable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/create-recovery-otp.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "description": "User email.", + "type": "string", + "example": "email@example.com", + "format": "email" + }, + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + }, + "required": [ + "email" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (OTP)", + "operationId": "accountUpdateRecoveryOTP", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated.\n", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "recovery", + "demo": "account\/update-recovery-otp.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "" + }, + "secret": { + "description": "Valid recovery OTP code.", + "type": "string", + "example": "" + }, + "password": { + "description": "New user password. Must be between 8 and 256 chars.", + "type": "string", + "example": "password", + "format": "password" + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/id-token": { + "post": { + "summary": "Create ID token session", + "operationId": "accountCreateIdTokenSession", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider's published signing keys and a session is created in a single request.\n\nNative sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow's enabled setting, which has no effect on this endpoint. The token's audience must match the provider's configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app's bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them.\n\nPass the raw nonce used when requesting the ID token so it can be validated against the token's nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user's name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nThis flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Appwrite cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "sessions", + "demo": "account\/create-id-token-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "provider": { + "description": "OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google.", + "type": "string", + "example": "apple", + "title": "IdTokenProvider", + "oneOf": [ + { + "type": "string", + "enum": [ + "apple" + ], + "title": "apple" + }, + { + "type": "string", + "enum": [ + "google" + ], + "title": "google" + } + ] + }, + "idToken": { + "description": "OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple.", + "type": "string", + "example": "" + }, + "nonce": { + "description": "Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce.", + "type": "string", + "default": "", + "example": "" + }, + "accessToken": { + "description": "Provider access token to store alongside the session for calling provider APIs. Never used for authentication.", + "type": "string", + "default": "", + "example": "" + }, + "accessTokenExpiry": { + "description": "Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale.", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + }, + "name": { + "description": "User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization.", + "type": "string", + "default": "", + "example": "" + } + }, + "required": [ + "provider", + "idToken" + ] + } + } + } + } + } + }, + "\/account\/verifications\/email\/otp": { + "post": { + "summary": "Create email verification (OTP)", + "operationId": "accountCreateEmailVerificationOTP", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a 6-digit verification code to the currently logged in user's email address. Unlike [createEmailVerification](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailVerification), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmailVerificationOTP). The code sent to the user's email address is valid for 15 minutes.\n\nEnable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/create-email-verification-otp.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phrase": { + "description": "Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "type": "boolean", + "default": false, + "example": false + } + } + } + } + } + } + }, + "put": { + "summary": "Update email verification (OTP)", + "operationId": "accountUpdateEmailVerificationOTP", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by [createEmailVerificationOTP](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailVerificationOTP). Pass the **userId** of the user being verified along with the **secret** code from the email. If confirmed, this route will return a 200 status code and the code is consumed.\n", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "verification", + "demo": "account\/update-email-verification-otp.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "description": "User ID.", + "type": "string", + "example": "" + }, + "secret": { + "description": "Valid verification OTP code.", + "type": "string", + "example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/photo": { + "get": { + "summary": "Get user photo", + "operationId": "avatarsGetPhoto", + "tags": [ + "avatars" + ], + "description": "Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: a custom uploaded photo (see avatars.updatePhoto), OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.\n\nPassing `userId` \u2014 `current()` for the authenticated user \u2014 resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and\/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL.", + "responses": { + "200": { + "description": "Image", + "content": { + "image\/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/get-photo.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "avatars.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [], + "ImpersonateUserId": [] + }, + "client": { + "Project": [], + "ImpersonateUserId": [] + }, + "server": { + "Project": [], + "Session": [], + "ImpersonateUserId": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + }, + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [], + "ImpersonateUserId": [] + } + ], + "parameters": [ + { + "name": "width", + "description": "Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "height", + "description": "Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 256 + }, + "in": "query" + }, + { + "name": "quality", + "description": "Output image quality between 0 and 100. Defaults to 100.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "example": 0, + "default": 100 + }, + "in": "query" + }, + { + "name": "output", + "description": "Output image format. Defaults to 'png'.", + "required": false, + "schema": { + "type": "string", + "example": "png", + "default": "png" + }, + "in": "query" + }, + { + "name": "rating", + "description": "Maximum image rating to fetch from Gravatar\/Libravatar. Defaults to 'g'.", + "required": false, + "schema": { + "type": "string", + "example": "g", + "default": "g" + }, + "in": "query" + }, + { + "name": "userId", + "description": "User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed.", + "required": false, + "schema": { + "type": "string", + "example": "current()", + "default": "" + }, + "in": "query" + }, + { + "name": "emailHash", + "description": "SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself.", + "required": false, + "schema": { + "type": "string", + "example": "", + "default": "" + }, + "in": "query" + }, + { + "name": "name", + "description": "Name to render initials from instead of the user's own name. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Update photo", + "operationId": "avatarsUpdatePhoto", + "tags": [ + "avatars" + ], + "description": "Update the profile photo of the currently authenticated user. The uploaded image takes priority over every other photo source, including OAuth2 identity photos, Gravatar, and Libravatar. Updating an already customized photo replaces it. The image must be at most 5MB and is sent in a single request.", + "responses": { + "200": { + "description": "Account", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/account" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/update-photo.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "avatars.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "description": "Binary image file of at most 5MB. Allowed file types are png, jpg, jpeg, and webp.", + "type": "string", + "format": "binary" + } + }, + "required": [ + "file" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete photo", + "operationId": "avatarsDeletePhoto", + "tags": [ + "avatars" + ], + "description": "Delete the profile photo of the currently authenticated user and store the built-in static placeholder in its place. The placeholder is the user's photo from then on, so it takes priority over every other photo source \u2014 OAuth2 identity photos, Gravatar, Libravatar, and initials \u2014 until a new photo is uploaded with avatars.updatePhoto.", + "responses": { + "204": { + "description": "No content" + } + }, + "deprecated": false, + "x-appwrite": { + "group": null, + "demo": "avatars\/delete-photo.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "avatars.write", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "client": { + "Project": [] + }, + "server": { + "Project": [], + "Session": [] + } + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/providers\/appwrite": { + "post": { + "summary": "Create Appwrite provider", + "operationId": "messagingCreateAppwriteProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Appwrite push provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/create-appwrite-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "type": "string", + "example": "" + }, + "name": { + "description": "Provider name.", + "type": "string", + "example": "" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "qos": { + "description": "Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + }, + "expiry": { + "description": "Default message retention in seconds for offline delivery. Max 7 days (604800).", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/appwrite\/{providerId}": { + "patch": { + "summary": "Update Appwrite provider", + "operationId": "messagingUpdateAppwriteProvider", + "tags": [ + "messaging" + ], + "description": "Update an Appwrite push provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "providers", + "demo": "messaging\/update-appwrite-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Provider name.", + "type": "string", + "default": "", + "example": "" + }, + "enabled": { + "description": "Set as enabled.", + "type": "boolean", + "example": false, + "nullable": true + }, + "qos": { + "description": "Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + }, + "expiry": { + "description": "Default message retention in seconds for offline delivery. Max 7 days (604800).", + "type": "integer", + "example": 0, + "format": "int32", + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/kakao": { + "patch": { + "summary": "Update project OAuth2 Kakao", + "operationId": "projectUpdateOAuth2Kakao", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Kakao configuration.", + "responses": { + "200": { + "description": "OAuth2Kakao", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Kakao" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-kakao.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de", + "type": "string", + "example": "", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled", + "type": "string", + "example": "", + "nullable": true + }, + "prompt": { + "description": "Array of Kakao OAuth2 prompt values. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. \"login\" means: prompt the user to re-authenticate. \"create\" means: prompt the user to sign up. \"select_account\" means: prompt the user to select an account. Pass an empty array to use the Kakao default.", + "type": "array", + "items": { + "title": "ProjectOAuth2KakaoPrompt", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ], + "title": "none" + }, + { + "type": "string", + "enum": [ + "login" + ], + "title": "login" + }, + { + "type": "string", + "enum": [ + "create" + ], + "title": "create" + }, + { + "type": "string", + "enum": [ + "select_account" + ], + "title": "select_account" + } + ] + }, + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/tiktok": { + "patch": { + "summary": "Update project OAuth2 TikTok", + "operationId": "projectUpdateOAuth2TikTok", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 TikTok configuration.", + "responses": { + "200": { + "description": "OAuth2TikTok", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2TikTok" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-tik-tok.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0", + "type": "string", + "example": "", + "nullable": true + }, + "clientSecret": { + "description": "'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite", + "type": "string", + "example": "", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/oauth2\/webflow": { + "patch": { + "summary": "Update project OAuth2 Webflow", + "operationId": "projectUpdateOAuth2Webflow", + "tags": [ + "project" + ], + "description": "Update the project OAuth2 Webflow configuration.", + "responses": { + "200": { + "description": "OAuth2Webflow", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/oAuth2Webflow" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "oauth2", + "demo": "project\/update-o-auth-2-webflow.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "project.oauth2.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "clientId": { + "description": "'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd", + "type": "string", + "example": "", + "nullable": true + }, + "clientSecret": { + "description": "'Client Secret' of Webflow OAuth2 app. For example: 59bf00000000000000000000000000000000000000000000000000000000fe59", + "type": "string", + "example": "", + "nullable": true + }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + } + } + } + } + } + } + } + }, + "\/project\/policies\/password-pwned": { + "patch": { + "summary": "Update password pwned policy", + "operationId": "projectUpdatePasswordPwnedPolicy", + "tags": [ + "project" + ], + "description": "Updating this policy allows you to control if passwords are checked against the Have I Been Pwned breach database. When enabled, every password a user signs up, signs in or resets with is checked and the result is recorded on the user as `passwordPwned`. On its own the policy only records. Enable `users` to reject a breached password when a user signs up or sets a new password, and `sessions` to refuse a sign-in with a breached password until it is reset. Only the first five characters of the password hash are ever shared with the service. Options left out keep their current value.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "policies", + "demo": "project\/update-password-pwned-policy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "policies.write", + "project.policies.write" + ], + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "console": { + "Project": [] + }, + "server": { + "Project": [], + "Key": [] + } + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "description": "Toggle password pwned policy. Set to true to check passwords against known data breaches and record the result on the user, or false to never check. Default is true. On its own this only records; use `users` and `sessions` to block. When changing this policy, existing passwords remain valid.", + "type": "boolean", + "example": false + }, + "sessions": { + "description": "Whether a sign-in with a breached password is refused until the password is reset. Default is false, which allows the sign-in and only records the result.", + "type": "boolean", + "example": false + }, + "users": { + "description": "Whether a breached password is rejected when a user signs up or sets a new password. Default is false, which allows the password and only records the result.", + "type": "boolean", + "example": false + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/plugins/openapi/testdata/golden/appwrite.json b/plugins/openapi/testdata/golden/appwrite.json new file mode 100644 index 0000000..0a0aebd --- /dev/null +++ b/plugins/openapi/testdata/golden/appwrite.json @@ -0,0 +1,296 @@ +[ + { + "id": 1, + "fingerprint": "sha256:2818da4b58b897f5c9c83a9355ee19782c7e698dcf268e4bb91a5be4cedae129", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "GET /databases/transactions" + }, + "description": "Operation GET /databases/transactions marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1transactions/get/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.listTransactions\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 2, + "fingerprint": "sha256:036c1afc3738d24431f2c04227bb01f881d9382417f1c7b79f7d1f1cfc4cb619", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "POST /databases/transactions" + }, + "description": "Operation POST /databases/transactions marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1transactions/post/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.createTransaction\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 3, + "fingerprint": "sha256:0fa0441207b019db9f6230dab29a2921cafe06b603620fe95b9b350a32614c34", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "DELETE /databases/transactions/{transactionId}" + }, + "description": "Operation DELETE /databases/transactions/{transactionId} marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1transactions~1{transactionId}/delete/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.deleteTransaction\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 4, + "fingerprint": "sha256:54e3cdfeea949e4772d2aa28bdf1834e68975c4751889ca3d25e0f4712de657a", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "GET /databases/transactions/{transactionId}" + }, + "description": "Operation GET /databases/transactions/{transactionId} marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1transactions~1{transactionId}/get/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.getTransaction\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 5, + "fingerprint": "sha256:4a25dba4764fa6d9b86d2019bd641cea0c68643160bf186020a72015f780875c", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "PATCH /databases/transactions/{transactionId}" + }, + "description": "Operation PATCH /databases/transactions/{transactionId} marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1transactions~1{transactionId}/patch/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.updateTransaction\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 6, + "fingerprint": "sha256:5d309ddb79e409e7360538d8b6e15e65c4c6bcb6196a43dbe298fd8d2ce04ac6", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "POST /databases/transactions/{transactionId}/operations" + }, + "description": "Operation POST /databases/transactions/{transactionId}/operations marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1transactions~1{transactionId}~1operations/post/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.createOperations\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 7, + "fingerprint": "sha256:3c6f71dc8e690e6c4f09204bdb100e347853794fb974faf8057569ed43ee3e83", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "POST /databases/{databaseId}/collections/{collectionId}/attributes/longtext" + }, + "description": "Operation POST /databases/{databaseId}/collections/{collectionId}/attributes/longtext marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1longtext/post/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.createLongtextColumn\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 8, + "fingerprint": "sha256:5ce4bde92237b928d9095dd3b3a489a50a576ce2193168cbe8a42e3c1fc581fc", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "PATCH /databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}" + }, + "description": "Operation PATCH /databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key} marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1longtext~1{key}/patch/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.updateLongtextColumn\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 9, + "fingerprint": "sha256:e4196475da31bde80bb82de02202a3b1da92e663361e29421bfa89e7b7f8c09e", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "POST /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext" + }, + "description": "Operation POST /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1mediumtext/post/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.createMediumtextColumn\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 10, + "fingerprint": "sha256:5a51623a86b22252bcbaebedeaa77a4608e2b9a7684aae47f2b1d1775e063b35", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "PATCH /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}" + }, + "description": "Operation PATCH /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key} marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1mediumtext~1{key}/patch/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.updateMediumtextColumn\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 11, + "fingerprint": "sha256:2d856b5de3c85083113531289e288e2d885df35a33e788fe924cd3eca713c6af", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "POST /databases/{databaseId}/collections/{collectionId}/attributes/text" + }, + "description": "Operation POST /databases/{databaseId}/collections/{collectionId}/attributes/text marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1text/post/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.createTextColumn\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 12, + "fingerprint": "sha256:630f92b0380411ade789ccd99a285702729de139c849722c24161b62439ecaca", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "PATCH /databases/{databaseId}/collections/{collectionId}/attributes/text/{key}" + }, + "description": "Operation PATCH /databases/{databaseId}/collections/{collectionId}/attributes/text/{key} marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1text~1{key}/patch/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.updateTextColumn\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 13, + "fingerprint": "sha256:c83df968cf8a2a630a01992691e82973bcd990a54e3d9363721d12d7c89d41a9", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "POST /databases/{databaseId}/collections/{collectionId}/attributes/varchar" + }, + "description": "Operation POST /databases/{databaseId}/collections/{collectionId}/attributes/varchar marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1varchar/post/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.createVarcharColumn\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 14, + "fingerprint": "sha256:2d470fd05117935022c3e99f8524b722ac1f496d7777010e8b2fda4aa8a2ddf8", + "api": "appwrite", + "version": "1.9.5", + "previous_version": "1.9.5", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "PATCH /databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}" + }, + "description": "Operation PATCH /databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key} marked deprecated.", + "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", + "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1varchar~1{key}/patch/x-appwrite/deprecated", + "source_excerpt": "{\"replaceWith\":\"tablesDB.updateVarcharColumn\",\"since\":\"1.8.0\"}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + } +] diff --git a/providers/README.md b/providers/README.md index 9e5821f..510b145 100644 --- a/providers/README.md +++ b/providers/README.md @@ -19,6 +19,7 @@ One page per plugin id: `providers/.md`. Start from [`_template.md`](_templ | [algolia.md](algolia.md) | `algolia-search`, `algolia-ingestion`, `algolia-recommend` | `openapi` | | [elasticsearch.md](elasticsearch.md) | `elasticsearch` | `openapi` | | [sentry.md](sentry.md) | `sentry` | `openapi` | +| [appwrite.md](appwrite.md) | `appwrite` | `openapi` | | [openai-models.md](openai-models.md) | `openai-models` | `retirements` | | [anthropic-models.md](anthropic-models.md) | `anthropic-models` | `retirements` | | [anthropic.md](anthropic.md) | `anthropic` | `migrationguide` | diff --git a/providers/appwrite.md b/providers/appwrite.md new file mode 100644 index 0000000..b3c283c --- /dev/null +++ b/providers/appwrite.md @@ -0,0 +1,49 @@ +# Appwrite (`appwrite`) + +## What it watches + +The Appwrite REST API as a server SDK calls it (the operations an Appwrite server SDK, in a repo's backend code, can call): operations Appwrite marks deprecated between two commits of its OpenAPI spec. SDK method renames that don't deprecate the route are left out, and so are removals. + +Format plugin: `openapi` (`plugins/openapi`), with `adapter.Appwrite`. + +## Why this source + +- **Source:** [appwrite/specs](https://github.com/appwrite/specs) (BSD-3-Clause), the newest minor's spec at the newest commit that changed `specs/`: `https://raw.githubusercontent.com/appwrite/specs//specs/.x/open-api3-.x.json`, or `open-api3-.x-server.json` in a directory without the single document. The newest minor is the highest `.x` directory by number (`specs/latest` is a copy and is skipped). Checked on 2026-11-19. +- **Why this one:** + - It's Appwrite's own description of the API, one spec per server minor, published by Appwrite. Its API reference reads it: "The Console's Cloud API reference reads the newest numbered spec" (commit `06e6fafa`). + - It marks deprecations twice over: the `deprecated` flag, and `x-appwrite.deprecated` with what to use instead (`{"since": "1.8.0", "replaceWith": "tablesDB.createTransaction"}`). + - Each commit can be cited and replayed: 139 commits on `main` from 2026-02-17 to 2026-11-17. +- **Alternatives considered:** + - **`app/config/specs` in [appwrite/appwrite](https://github.com/appwrite/appwrite).** The same specs, but they stopped there: commit `8d82bc89` (2026-02-18) removed them from the repo ("remove specs from git tracking"), and the last release tag with them is `1.8.1`. + - **The SDK changelogs** (`CHANGELOG.md` in `appwrite/sdk-for-node` and the others). They list real removals ("* Breaking: removed `account.listLogs`, `users.listLogs` ..."), but per SDK and in SDK versions, not API operations: a possible later `changelog` plugin, not this one. + - **No deprecations page:** `https://appwrite.io/docs/deprecations` redirects to the quick starts. + - **The [changelog](https://appwrite.io/changelog)** (RSS at `https://appwrite.io/changelog/rss.xml`): its 50 posts from 2026-09-30 to 2026-11-19 never say "deprecated" or "breaking". Product news. +- **Quote:** `"deprecated": {"since": "1.8.0", "replaceWith": "tablesDB.createTransaction"}` (`POST /databases/transactions`, flagged in the 1.9.x server spec on 2026-06-24) + +## How the provider announces changes + +- **One spec per server minor**, `specs/.x/`, updated on `main` many times per minor. No tags or releases in the repo, so a commit SHA pins a spec. Commits don't line up with Appwrite's releases: on 2026-11-19 the newest spec says `2.7.2` while appwrite/appwrite has released `2.7.4`. +- **The layout changed once.** Up to 1.9.x a directory has one document per platform (`-client`, `-console`, `-server`); from 2.0.x there's one document, each operation listing its platforms in `x-appwrite.platforms` (2.3.x and 2.4.x also have the per-platform files). The adapter reads the single document when there is one and keeps the operations on `server`. At `0ccd20ab` (1.9.x and 2.0.x) and `98cc1a25` (2.4.x's two) that gives the operations the server document has. Where they part, the single document is the one kept up: `06e6fafa` changed 2.4.x's single document only. +- **The `deprecated` flag marks two things.** A route Appwrite wants callers off (the legacy Databases API, replaced by TablesDB in 1.8.0). Or an SDK method name renamed while the route stays: `POST /account/mfa/challenges` is flagged with `"replaceWith": "account.createMFAChallenge"`, which is the same operation's other name in `x-appwrite.methods` (`createMfaChallenge` became `createMFAChallenge`). 23 of the 99 operations flagged in 2.7.x's server operations are renames. All 23 have been flagged since 1.8.0, and 1.8.x's server spec at `ac705cd3` has the same 23. +- **`since` isn't a date and isn't when the flag came.** The 14 flags added on 2026-06-24 all say `"since": "1.8.0"`, in a spec whose `info.version` was 1.9.5. It's quoted, not used. +- **The event's `version` is the spec's `info.version`**, the Appwrite server version it describes (`1.9.5`). That's also the version the server SDKs send as `X-Appwrite-Response-Format` (`2.7.2` in node-appwrite 32.0.0 and the Python SDK 28.0.0). + +## What the plugin reads and ignores + +- **Reads:** the newest minor's server operations at the newest commit, diffed against the last ones seen. One kind of event comes out: **deprecations**, an operation that gains the `deprecated` flag. The event quotes `x-appwrite.deprecated` (since and replaceWith), which is where the spec says what to use instead; descriptions don't say. Quoting the whole operation could lose it to the 2,000-character cut, because `x-appwrite` sorts last. +- **Matches operations by path template**, as the other specs do. +- **Ignores:** + - **SDK method renames.** A flag whose `replaceWith` names a method of the same operation's `x-appwrite.methods` isn't read as a deprecation (`diff.Options.FlagNotDeprecation`). If such an operation is later deprecated for another operation, that's an event then. From 1.7.x to 1.8.x (both at `ac705cd3`) this leaves out 21 of the 71 new flags. The other 50 are the Databases API's deprecations in favor of TablesDB. + - **Removals, all of them,** even of deprecated operations. Read as the plugin reads it (139 commits on `main`), 78 operations left the server operations (from the spec, or from the `server` platform). Only one had been flagged first, and it was a path move: `PATCH .../attributes/{key}/relationship` became `.../attributes/relationship/{key}` on 2026-03-20. 13 are back now: on 2026-10-12, `06e6fafa` took `server` off 13 operations of 2.4.x's single document ("listed server and client methods no released SDK ships yet"), and 2.5.x had them on `server` again the next day. Nothing in the spec says when an operation stops answering. + - **Request and response property changes, and new operations.** +- Over the 139 commits this keeps 14 events, all on 2026-06-24 (`7d74bf9f`): the six `/databases/transactions` operations and the `longtext`, `mediumtext`, `text` and `varchar` attribute operations, each replaced by a `tablesDB` method. None is a rename, so the filter drops none of them. +- **Replays** a pair of commits (`Replay`, as the golden test does from `8c00ba35` to `7d74bf9f`). A tag can name an older minor's directory, `1.7.x@`, as the rename test does. The pinned drop test is the 2.4.x pair (13 removals, no event). + +## Known gaps + +- **Removals aren't events.** The spec doesn't mark them first, so real ones are missed. The SDK changelogs say them ("* Breaking: removed `X`"); a `changelog` plugin per SDK could read them. +- **Deprecations from before the plugin's first run aren't events,** nor ones that came with a new minor's directory already flagged. The Databases to TablesDB deprecations of 1.8.0 can be replayed (`1.7.x@` to ``), and a run never sees them. +- **The layout changed once (2.0.x) and may again.** The adapter fails, rather than guess, when a directory has neither file. +- **Spec commits aren't releases.** A deprecation's `version` is what the spec says at that commit, which can trail the release. Two commits can share an `info.version` (8c00ba35 and 7d74bf9f are both `1.9.5`), so `previous_version` can equal `version`. +- **Client and console operations aren't watched.** Only what a server SDK can call. +- **The patch-it client can't place these events against an SDK pin.** It reads an `api_operation` event's `version` as a package version and compares it with the repo's pin. Appwrite's SDKs are versioned on their own (node-appwrite 32.0.0, the Python SDK 28.0.0, both sending `X-Appwrite-Response-Format: 2.7.2`), so a pin on an SDK reads every server version as already passed, and the events are dropped. They're placed right only when the tracked `appwrite` entry pins the server version (`version_range: ">=1.9,<2"`). Otherwise the client needs an SDK release to response-format table, like Stripe's. From 353d6cb40de36bd1b2554f56c85845a9044e2514 Mon Sep 17 00:00:00 2001 From: brandonphelps1212 Date: Thu, 19 Nov 2026 19:47:18 -0500 Subject: [PATCH 2/3] appwrite: date versions, /v1 paths, stricter method-level filter Version is the specs commit's date, for the client's date-versioned gate: a server version can't be placed against an SDK pin. Operations are named by the path a caller sends (/v1/...) through ServerBasePath, with pointers into the spec as published. A deprecated flag on an operation that still has a live SDK method isn't read as a deprecation, and a single document with no server operation fails the fetch. Co-Authored-By: Claude Opus 5.5 Signed-off-by: brandonphelps1212 --- adapter/appwrite.go | 56 +++++-- adapter/appwrite_test.go | 41 ++++- plugins/openapi/appwrite.go | 47 +++--- plugins/openapi/appwrite_test.go | 64 ++++++-- plugins/openapi/testdata/golden/appwrite.json | 140 +++++++++--------- providers/appwrite.md | 13 +- 6 files changed, 233 insertions(+), 128 deletions(-) diff --git a/adapter/appwrite.go b/adapter/appwrite.go index 4759d9a..1243072 100644 --- a/adapter/appwrite.go +++ b/adapter/appwrite.go @@ -10,6 +10,7 @@ import ( "slices" "strconv" "strings" + "time" "github.com/patch-it-dev/patch-it-plugins/fetch" ) @@ -86,9 +87,13 @@ func (a Appwrite) LatestTag(ctx context.Context) (string, error) { // Fetch downloads the spec at a commit: the newest minor's directory, or the // one the tag names ("1.8.x@"). // -// Version is the spec's info.version, the Appwrite server version it -// describes ("1.9.5", "2.7.2"): the version the server SDKs send as -// X-Appwrite-Response-Format. +// Version is the commit's date (YYYY-MM-DD), not the spec's info.version +// ("1.9.5"), the server version it describes: a repo pins an SDK +// (node-appwrite 32.0.0, the Python SDK 28.0.0), versioned apart from the +// server, so a server version can't be placed against the pin, and the +// specs commits don't line up with server releases anyway. +// +// The server URL's path (/v1) is moved into the paths: see ServerBasePath. func (a Appwrite) Fetch(ctx context.Context, tag string) (Spec, error) { dir, sha, named := strings.Cut(tag, "@") if !named { @@ -97,6 +102,23 @@ func (a Appwrite) Fetch(ctx context.Context, tag string) (Spec, error) { if !appwriteCommit.MatchString(sha) || (named && !appwriteDir.MatchString(dir)) { return Spec{}, fmt.Errorf("%q is neither a full appwrite/specs commit sha nor .x@", tag) } + meta, err := fetch.Get(ctx, a.api("/commits/"+sha), githubHeaders()) + if err != nil { + return Spec{}, fmt.Errorf("looking up appwrite/specs commit %s: %w", sha, err) + } + var commit struct { + Commit struct { + Committer struct { + Date time.Time `json:"date"` + } `json:"committer"` + } `json:"commit"` + } + if err := json.Unmarshal(meta, &commit); err != nil { + return Spec{}, fmt.Errorf("parsing github commit %s: %w", sha, err) + } + if commit.Commit.Committer.Date.IsZero() { + return Spec{}, fmt.Errorf("github commit %s has no date", sha) + } if dir == "" { dirs, err := a.list(ctx, "specs", sha) if err != nil { @@ -130,20 +152,21 @@ func (a Appwrite) Fetch(ctx context.Context, tag string) (Spec, error) { return Spec{}, fmt.Errorf("appwrite spec %s: %w", tag, err) } } - var doc struct { - Info struct { - Version string `json:"version"` - } `json:"info"` - } - if err := json.Unmarshal(body, &doc); err != nil { - return Spec{}, fmt.Errorf("appwrite spec %s is not valid json: %w", tag, err) - } - if doc.Info.Version == "" { - return Spec{}, fmt.Errorf("appwrite spec %s has no info.version", tag) + // Every server is "https://cloud.appwrite.io/v1" or a regional + // "https://{region}.cloud.appwrite.io/v1" ("" up to 1.8.x), and + // the paths don't repeat /v1. + content, err := ServerBasePath(body) + if err != nil { + return Spec{}, fmt.Errorf("appwrite spec %s: %w", tag, err) } - return Spec{Content: body, Version: doc.Info.Version, SourceURL: url}, nil + return Spec{Content: content, Version: commit.Commit.Committer.Date.UTC().Format("2006-01-02"), SourceURL: url}, nil } +// SourcePointer: see BasePathPointer. +func (Appwrite) SourcePointer(content []byte) func(string) string { return BasePathPointer(content) } + +var _ Reshaper = Appwrite{} + // list is the names in a directory of appwrite/specs at a commit. func (a Appwrite) list(ctx context.Context, path, sha string) ([]string, error) { body, err := fetch.Get(ctx, a.api("/contents/"+path+"?ref="+sha), githubHeaders()) @@ -187,6 +210,8 @@ func newestAppwriteDir(names []string) string { // x-appwrite.platforms has "server", and drops a path left with none. The // kept values are unchanged (numbers kept as written) and nothing moves, so // a pointer into what's kept names the same node in the published file. +// None kept is an error, not an empty spec: it means the platforms moved or +// were renamed, and an empty spec would read as nothing deprecated. func appwriteServerOnly(body []byte) ([]byte, error) { dec := json.NewDecoder(bytes.NewReader(body)) dec.UseNumber() @@ -214,5 +239,8 @@ func appwriteServerOnly(body []byte) ([]byte, error) { delete(paths, p) } } + if len(paths) == 0 { + return nil, fmt.Errorf("no operation has \"server\" in x-appwrite.platforms") + } return json.Marshal(doc) } diff --git a/adapter/appwrite_test.go b/adapter/appwrite_test.go index 88c75f9..ecdb139 100644 --- a/adapter/appwrite_test.go +++ b/adapter/appwrite_test.go @@ -11,7 +11,8 @@ import ( const appwriteSHA = "06e6fafa4d1ae3c815843ff0b02a56e6e5582756" -// fakeAppwriteGitHub serves the commits list, directory listings +// fakeAppwriteGitHub serves the commits list, appwriteSHA's commit (dated +// 2026-10-12T18:11:38Z, as GitHub dates it), directory listings // ("?ref=" -> names) and raw files ("//specs//"). func fakeAppwriteGitHub(t *testing.T, commits string, listings, raw map[string]string) Appwrite { t.Helper() @@ -24,6 +25,8 @@ func fakeAppwriteGitHub(t *testing.T, commits string, listings, raw map[string]s return } w.Write([]byte(commits)) + case r.URL.Path == repo+"/commits/"+appwriteSHA: + w.Write([]byte(`{"sha":"` + appwriteSHA + `","commit":{"committer":{"date":"2026-10-12T18:11:38Z"}}}`)) case strings.HasPrefix(r.URL.Path, repo+"/contents/"): names, ok := listings[strings.TrimPrefix(r.URL.Path, repo+"/contents/")+"?ref="+r.URL.Query().Get("ref")] if !ok { @@ -65,7 +68,7 @@ func TestAppwriteLatestTagIsTheNewestSpecsCommit(t *testing.T) { // platform; the newest minor is the highest by number, not "latest" and not // by string order. func TestAppwriteFetchReadsTheNewestMinorsServerOperations(t *testing.T) { - const doc = `{"openapi":"3.0.0","info":{"version":"2.10.1"},"paths":{` + + const doc = `{"openapi":"3.0.0","info":{"version":"2.10.1"},"servers":[{"url":"https://cloud.appwrite.io/v1"},{"url":"https://{region}.cloud.appwrite.io/v1"}],"paths":{` + `"/both":{"get":{"x-appwrite":{"platforms":["client","server"]},"x-n":1.50},"post":{"x-appwrite":{"platforms":["console"]}}},` + `"/console":{"get":{"x-appwrite":{"platforms":["console"]}},"parameters":[]}}}` a := fakeAppwriteGitHub(t, "", map[string]string{ @@ -76,12 +79,34 @@ func TestAppwriteFetchReadsTheNewestMinorsServerOperations(t *testing.T) { if err != nil { t.Fatal(err) } - if spec.Version != "2.10.1" || !strings.HasSuffix(spec.SourceURL, "/raw/appwrite/specs/"+appwriteSHA+"/specs/2.10.x/open-api3-2.10.x.json") { + if spec.Version != "2026-10-12" || !strings.HasSuffix(spec.SourceURL, "/raw/appwrite/specs/"+appwriteSHA+"/specs/2.10.x/open-api3-2.10.x.json") { t.Errorf("version %q, url %s", spec.Version, spec.SourceURL) } - if want := `{"info":{"version":"2.10.1"},"openapi":"3.0.0","paths":{"/both":{"get":{"x-appwrite":{"platforms":["client","server"]},"x-n":1.50}}}}`; string(spec.Content) != want { + want := `{"info":{"version":"2.10.1"},"openapi":"3.0.0","paths":{"/v1/both":{"get":{"x-appwrite":{"platforms":["client","server"]},"x-n":1.50}}},` + + `"servers":[{"url":"https://cloud.appwrite.io/v1"},{"url":"https://{region}.cloud.appwrite.io/v1"}],"x-patch-it-base-path":"/v1"}` + if string(spec.Content) != want { t.Errorf("content %s, want %s", spec.Content, want) } + // A pointer into /v1/both names the path as published. + if got := (Appwrite{}).SourcePointer(spec.Content)("/paths/~1v1~1both/get/x-appwrite/deprecated"); got != "/paths/~1both/get/x-appwrite/deprecated" { + t.Errorf("source pointer %s", got) + } +} + +// A single document where no operation is on the server any more (the +// platforms renamed, or gone) is an error, not a spec with nothing in it. +func TestAppwriteFetchFailsWithNoServerOperations(t *testing.T) { + for name, doc := range map[string]string{ + "no platforms": `{"openapi":"3.0.0","info":{"version":"2.8.0"},"paths":{"/a":{"get":{"x-appwrite":{}}}}}`, + "renamed platform": `{"openapi":"3.0.0","info":{"version":"2.8.0"},"paths":{"/a":{"get":{"x-appwrite":{"platforms":["backend"]}}}}}`, + } { + a := fakeAppwriteGitHub(t, "", map[string]string{ + "specs/2.8.x?ref=" + appwriteSHA: "open-api3-2.8.x.json", + }, map[string]string{"/" + appwriteSHA + "/specs/2.8.x/open-api3-2.8.x.json": doc}) + if _, err := a.Fetch(context.Background(), "2.8.x@"+appwriteSHA); err == nil || !strings.Contains(err.Error(), "server") { + t.Errorf("%s: got %v, want an error about the server platform", name, err) + } + } } // A per-platform directory is read as published; a tag can name the @@ -95,7 +120,7 @@ func TestAppwriteFetchServerDocumentAndNamedDirectory(t *testing.T) { if err != nil { t.Fatal(err) } - if spec.Version != "1.7.4" || string(spec.Content) != doc { + if spec.Version != "2026-10-12" || string(spec.Content) != doc { t.Errorf("version %q, content %s", spec.Version, spec.Content) } } @@ -106,9 +131,10 @@ func TestAppwriteFetchFailures(t *testing.T) { "specs/1.9.x?ref=" + appwriteSHA: "open-api3-1.9.x-client.json", "specs/1.8.x?ref=" + appwriteSHA: "open-api3-1.8.x-server.json", "specs/1.6.x?ref=" + appwriteSHA: "open-api3-1.6.x-server.json", + "specs/1.5.x?ref=" + appwriteSHA: "open-api3-1.5.x-server.json", } raw := map[string]string{ - "/" + appwriteSHA + "/specs/1.8.x/open-api3-1.8.x-server.json": `{"info":{}}`, + "/" + appwriteSHA + "/specs/1.5.x/open-api3-1.5.x-server.json": `{"servers":[{"url":"https://a.io/v1"},{"url":"https://b.io/v2"}],"paths":{}}`, "/" + appwriteSHA + "/specs/1.6.x/open-api3-1.6.x-server.json": ``, } a := fakeAppwriteGitHub(t, "", listings, raw) @@ -116,7 +142,8 @@ func TestAppwriteFetchFailures(t *testing.T) { "short sha": "06e6fafa", "bad directory": "latest@" + appwriteSHA, "no server document": appwriteSHA, - "no info.version": "1.8.x@" + appwriteSHA, + "no file at commit": "1.8.x@" + appwriteSHA, + "servers disagree": "1.5.x@" + appwriteSHA, "invalid json": "1.6.x@" + appwriteSHA, "unknown commit": strings.Repeat("0", 40), } { diff --git a/plugins/openapi/appwrite.go b/plugins/openapi/appwrite.go index 0dc42a2..0b81d0d 100644 --- a/plugins/openapi/appwrite.go +++ b/plugins/openapi/appwrite.go @@ -16,33 +16,40 @@ import "github.com/patch-it-dev/patch-it-plugins/diff" // "account.createMFAChallenge", which is the same operation's other // name in x-appwrite.methods (createMfaChallenge became // createMFAChallenge). The route isn't deprecated, so that flag isn't -// read as a deprecation: see appwriteMethodRename. +// read as a deprecation: see appwriteMethodLevel. // - Path parameters are matched by place, as for the other specs. var appwriteDiff = diff.Options{ PathTemplates: true, QuoteDeprecated: "/x-appwrite/deprecated", - FlagNotDeprecation: appwriteMethodRename, + FlagNotDeprecation: appwriteMethodLevel, } -// appwriteMethodRename reports whether an operation's deprecation is the -// rename of one of its SDK methods: x-appwrite.deprecated.replaceWith names -// a method of the same operation's x-appwrite.methods -// ("."). 23 of the 99 operations flagged in 2.7.x's server -// operations are, all flagged since 1.8.0 (1.8.x's server document at -// ac705cd3 has the same 23). -func appwriteMethodRename(op map[string]any) bool { +// appwriteMethodLevel reports whether an operation's `deprecated` flag is +// about its SDK methods, not its route: +// +// - x-appwrite.deprecated.replaceWith names a method of the same +// operation's x-appwrite.methods ("."): a rename; +// - or a method in x-appwrite.methods isn't itself deprecated: the +// operation still has a live SDK method, so the route stays. +// +// An operation with no methods listed (the 14 of the golden test have +// "methods": []) is read by its flag. In 2.7.x's server operations the two +// rules pick the same 23 of the 99 flagged, all flagged since 1.8.0 +// (1.8.x's server document at ac705cd3 has the same 23); each has a live +// method named by replaceWith. +func appwriteMethodLevel(op map[string]any) bool { xa, _ := op["x-appwrite"].(map[string]any) dep, _ := xa["deprecated"].(map[string]any) replaceWith, _ := dep["replaceWith"].(string) - if replaceWith == "" { - return false - } methods, _ := xa["methods"].([]any) for _, m := range methods { method, _ := m.(map[string]any) namespace, _ := method["namespace"].(string) name, _ := method["name"].(string) - if name != "" && namespace+"."+name == replaceWith { + if replaceWith != "" && name != "" && namespace+"."+name == replaceWith { + return true + } + if d, ok := method["deprecated"]; !ok || d == nil || d == false { return true } } @@ -53,15 +60,15 @@ func appwriteMethodRename(op map[string]any) bool { // operation's removal. Read as Fetch reads it (the newest minor's server // operations at each of the 139 commits on appwrite/specs' main, 2026-02-17 // to 2026-11-17), the spec's history has 14 deprecations, all on -// 2026-06-24 (see the golden test), and 78 operations leaving it (from the spec, or from the server -// platform), only one -// marked deprecated first, and that one a path move: PATCH +// 2026-06-24 (see the golden test), and 78 operations leaving it (from +// the spec, or from the server platform). Only one was marked deprecated +// first, and that one was a path move: PATCH // /databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship // became .../attributes/relationship/{key} on 2026-03-20. Of the others, 13 -// are back in the spec now: 2.4.x's single document took the server platform -// off them on 2026-10-12 as not yet in a released SDK, and 2.5.x had them -// on it again the next day. Nothing in the spec says when an operation stops answering, so a -// removal isn't an event. +// are back now: 2.4.x's single document took the server platform off them +// on 2026-10-12 as not yet in a released SDK, and 2.5.x had them on it again +// the next day. Nothing in the spec says when an operation stops answering, +// so a removal isn't an event. // // Property changes and new operations are dropped too, as for vercel. func appwriteKeep(c diff.Change) bool { return c.Kind == diff.OperationDeprecated } diff --git a/plugins/openapi/appwrite_test.go b/plugins/openapi/appwrite_test.go index ea94c7b..a4bf6f3 100644 --- a/plugins/openapi/appwrite_test.go +++ b/plugins/openapi/appwrite_test.go @@ -3,6 +3,7 @@ package openapi import ( "context" "encoding/json" + "fmt" "net/http" "net/http/httptest" "strings" @@ -14,7 +15,8 @@ import ( "github.com/patch-it-dev/patch-it-plugins/kit/kittest" ) -// The appwrite/specs commits the tests read (checked 2026-11-19). +// The appwrite/specs commits the tests read (checked 2026-11-19), and their +// committer dates, as GitHub gives them. const ( appwrite19Old = "8c00ba356b01d43fbc6c88c60fb2a4fc99e04b40" // 2026-06-19 appwrite19New = "7d74bf9f3c0c990745e822f5935bcfaca310fd06" // 2026-06-24 @@ -23,6 +25,14 @@ const ( appwrite18 = "ac705cd3e9d5e3a0693b7e40189eb1e66883e341" // 2026-02-18 ) +var appwriteDates = map[string]string{ + appwrite19Old: "2026-06-19T03:20:24Z", + appwrite19New: "2026-06-24T02:33:08Z", + appwrite24Old: "2026-10-08T15:06:26Z", + appwrite24New: "2026-10-12T18:11:38Z", + appwrite18: "2026-02-18T08:20:16Z", +} + // What GitHub lists in specs/ at each commit, as it did on 2026-11-19. var ( appwriteDirsTo19 = "0.10.x 0.11.x 0.12.x 0.13.x 0.14.x 0.15.x 0.6.x 0.7.x 0.8.x 0.9.x 1.0.x 1.1.x 1.2.x 1.3.x 1.4.x 1.5.x 1.6.x 1.7.x 1.8.x 1.9.x latest" @@ -55,6 +65,10 @@ func appwritePlugin(t *testing.T) (Plugin, string) { p, ref := r.URL.Path, r.URL.Query().Get("ref") var names []string switch { + case strings.HasPrefix(p, repo+"/commits/") && appwriteDates[strings.TrimPrefix(p, repo+"/commits/")] != "": + sha := strings.TrimPrefix(p, repo+"/commits/") + fmt.Fprintf(w, `{"sha":%q,"commit":{"committer":{"date":%q}}}`, sha, appwriteDates[sha]) + return case p == repo+"/contents/specs" && appwriteDirs[ref] != "": names = strings.Fields(appwriteDirs[ref]) case strings.HasPrefix(p, repo+"/contents/specs/") && appwriteFiles[ref+"/"+strings.TrimPrefix(p, repo+"/contents/specs/")] != nil: @@ -102,8 +116,10 @@ func TestAppwriteRegistersItself(t *testing.T) { // 1.9.x server spec flagged 14 more operations, 83 to 97: the six // /databases/transactions operations and the longtext, mediumtext, text and // varchar attribute operations of the legacy Databases API, each "since" -// 1.8.0 and replaced with a TablesDB method. None is an SDK method rename, -// so the filter keeps all 14. Each event quotes x-appwrite.deprecated. +// 1.8.0 and replaced with a TablesDB method. None is an SDK method rename or +// has a live method ("methods": []), so the filter keeps all 14. Each event +// is named by the path a caller sends (/v1/...), dated by the commit, and +// quotes x-appwrite.deprecated in the file as published. func TestAppwriteGolden(t *testing.T) { p, base := appwritePlugin(t) events := replayAppwrite(t, p, appwrite19Old, appwrite19New) @@ -113,7 +129,8 @@ func TestAppwriteGolden(t *testing.T) { file := appwriteFiles[appwrite19New+"/1.9.x"]["open-api3-1.9.x-server.json"] url := base + "/" + appwrite19New + "/specs/1.9.x/open-api3-1.9.x-server.json" for _, e := range events { - if e.ChangeType != event.ChangeTypeDeprecation || e.Breaking || e.Version != "1.9.5" || e.SourceURL != url { + if e.ChangeType != event.ChangeTypeDeprecation || e.Breaking || e.Version != "2026-06-24" || e.SourceURL != url || + !strings.Contains(e.Subject.Operation, " /v1/databases/") || strings.HasPrefix(e.SourcePointer, "/paths/~1v1") { t.Errorf("%s: %s %s from %s", e.Subject.Operation, e.ChangeType, e.Version, e.SourceURL) } if !strings.HasSuffix(e.SourcePointer, "/x-appwrite/deprecated") || jsonNode(t, file, e.SourcePointer) != e.SourceExcerpt { @@ -172,16 +189,16 @@ func TestAppwriteDropsSDKMethodRenames(t *testing.T) { t.Fatalf("every flag read: %d events, want 21", len(events)) } for _, e := range events { - if e.Version != "1.8.1" || e.PreviousVersion != "1.7.4" { + if e.Version != "2026-02-18" || e.PreviousVersion != "2026-02-18" { t.Errorf("%s: %s -> %s", e.Subject.Operation, e.PreviousVersion, e.Version) } } } -func TestAppwriteMethodRename(t *testing.T) { +func TestAppwriteMethodLevel(t *testing.T) { methods := []any{ - map[string]any{"namespace": "account", "name": "createMfaChallenge"}, - map[string]any{"namespace": "account", "name": "createMFAChallenge"}, + map[string]any{"namespace": "account", "name": "createMfaChallenge", "deprecated": map[string]any{"since": "1.8.0"}}, + map[string]any{"namespace": "account", "name": "createMFAChallenge", "deprecated": map[string]any{"since": "1.8.0"}}, } for name, c := range map[string]struct { replaceWith string @@ -196,11 +213,36 @@ func TestAppwriteMethodRename(t *testing.T) { "deprecated": map[string]any{"since": "1.8.0", "replaceWith": c.replaceWith}, "methods": methods, }} - if got := appwriteMethodRename(op); got != c.want { + if got := appwriteMethodLevel(op); got != c.want { + t.Errorf("%s: got %v, want %v", name, got, c.want) + } + } + for name, c := range map[string]struct { + methods []any + want bool + }{ + // A live method remains: the route stays, whatever replaceWith says. + "one method not deprecated": {[]any{ + map[string]any{"namespace": "databases", "name": "createX", "deprecated": map[string]any{"since": "1.8.0"}}, + map[string]any{"namespace": "databases", "name": "createY"}, + }, true}, + "deprecated: false": {[]any{map[string]any{"namespace": "databases", "name": "createX", "deprecated": false}}, true}, + "every method deprecated": {[]any{ + map[string]any{"namespace": "databases", "name": "createX", "deprecated": map[string]any{"since": "1.8.0"}}, + }, false}, + // As the 14 golden operations are: read by the flag. + "no methods": {[]any{}, false}, + "methods absent": {nil, false}, + } { + xa := map[string]any{"deprecated": map[string]any{"since": "1.8.0", "replaceWith": "tablesDB.createZ"}} + if c.methods != nil { + xa["methods"] = c.methods + } + if got := appwriteMethodLevel(map[string]any{"deprecated": true, "x-appwrite": xa}); got != c.want { t.Errorf("%s: got %v, want %v", name, got, c.want) } } - if appwriteMethodRename(map[string]any{"deprecated": true}) { - t.Error("an operation without x-appwrite reads as a rename") + if appwriteMethodLevel(map[string]any{"deprecated": true}) { + t.Error("an operation without x-appwrite reads as method-level") } } diff --git a/plugins/openapi/testdata/golden/appwrite.json b/plugins/openapi/testdata/golden/appwrite.json index 0a0aebd..71b51fd 100644 --- a/plugins/openapi/testdata/golden/appwrite.json +++ b/plugins/openapi/testdata/golden/appwrite.json @@ -1,19 +1,19 @@ [ { "id": 1, - "fingerprint": "sha256:2818da4b58b897f5c9c83a9355ee19782c7e698dcf268e4bb91a5be4cedae129", + "fingerprint": "sha256:d55bc2bc9326f99d1fb45d532acdaf3a9b3f607f00517726904566a275111aca", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "GET /databases/transactions" + "operation": "GET /v1/databases/transactions" }, - "description": "Operation GET /databases/transactions marked deprecated.", + "description": "Operation GET /v1/databases/transactions marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1transactions/get/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.listTransactions\",\"since\":\"1.8.0\"}", @@ -22,19 +22,19 @@ }, { "id": 2, - "fingerprint": "sha256:036c1afc3738d24431f2c04227bb01f881d9382417f1c7b79f7d1f1cfc4cb619", + "fingerprint": "sha256:54a92731e12a45f62ae7ca006da55acd8d0aeb850b717d0e91dcac6076805c97", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "POST /databases/transactions" + "operation": "POST /v1/databases/transactions" }, - "description": "Operation POST /databases/transactions marked deprecated.", + "description": "Operation POST /v1/databases/transactions marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1transactions/post/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.createTransaction\",\"since\":\"1.8.0\"}", @@ -43,19 +43,19 @@ }, { "id": 3, - "fingerprint": "sha256:0fa0441207b019db9f6230dab29a2921cafe06b603620fe95b9b350a32614c34", + "fingerprint": "sha256:1fa27c9a4c57ac607e966fab080b49ea80f21a8e7dce74c5befee3bb49170d1f", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "DELETE /databases/transactions/{transactionId}" + "operation": "DELETE /v1/databases/transactions/{transactionId}" }, - "description": "Operation DELETE /databases/transactions/{transactionId} marked deprecated.", + "description": "Operation DELETE /v1/databases/transactions/{transactionId} marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1transactions~1{transactionId}/delete/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.deleteTransaction\",\"since\":\"1.8.0\"}", @@ -64,19 +64,19 @@ }, { "id": 4, - "fingerprint": "sha256:54e3cdfeea949e4772d2aa28bdf1834e68975c4751889ca3d25e0f4712de657a", + "fingerprint": "sha256:6f4405889f51845aba9cd28d5a7178aecb016418b38da5f743acace34214a2ba", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "GET /databases/transactions/{transactionId}" + "operation": "GET /v1/databases/transactions/{transactionId}" }, - "description": "Operation GET /databases/transactions/{transactionId} marked deprecated.", + "description": "Operation GET /v1/databases/transactions/{transactionId} marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1transactions~1{transactionId}/get/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.getTransaction\",\"since\":\"1.8.0\"}", @@ -85,19 +85,19 @@ }, { "id": 5, - "fingerprint": "sha256:4a25dba4764fa6d9b86d2019bd641cea0c68643160bf186020a72015f780875c", + "fingerprint": "sha256:1fb114ac9b3bf37942cc8a7bb25fb1f9b002fa8915cb9404358186f04ec70a0c", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "PATCH /databases/transactions/{transactionId}" + "operation": "PATCH /v1/databases/transactions/{transactionId}" }, - "description": "Operation PATCH /databases/transactions/{transactionId} marked deprecated.", + "description": "Operation PATCH /v1/databases/transactions/{transactionId} marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1transactions~1{transactionId}/patch/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.updateTransaction\",\"since\":\"1.8.0\"}", @@ -106,19 +106,19 @@ }, { "id": 6, - "fingerprint": "sha256:5d309ddb79e409e7360538d8b6e15e65c4c6bcb6196a43dbe298fd8d2ce04ac6", + "fingerprint": "sha256:c2e616df4c77d3282681a23974037061c1c4e7a80a3416d4c0111f1b411e69af", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "POST /databases/transactions/{transactionId}/operations" + "operation": "POST /v1/databases/transactions/{transactionId}/operations" }, - "description": "Operation POST /databases/transactions/{transactionId}/operations marked deprecated.", + "description": "Operation POST /v1/databases/transactions/{transactionId}/operations marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1transactions~1{transactionId}~1operations/post/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.createOperations\",\"since\":\"1.8.0\"}", @@ -127,19 +127,19 @@ }, { "id": 7, - "fingerprint": "sha256:3c6f71dc8e690e6c4f09204bdb100e347853794fb974faf8057569ed43ee3e83", + "fingerprint": "sha256:e6990fcd55e828bece8dff3875ec79f1ef8a413c7571100ba7ed945fe9e1c539", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "POST /databases/{databaseId}/collections/{collectionId}/attributes/longtext" + "operation": "POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/longtext" }, - "description": "Operation POST /databases/{databaseId}/collections/{collectionId}/attributes/longtext marked deprecated.", + "description": "Operation POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/longtext marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1longtext/post/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.createLongtextColumn\",\"since\":\"1.8.0\"}", @@ -148,19 +148,19 @@ }, { "id": 8, - "fingerprint": "sha256:5ce4bde92237b928d9095dd3b3a489a50a576ce2193168cbe8a42e3c1fc581fc", + "fingerprint": "sha256:8a80864146f1af2386381acaaef299815f7563119c5679a546a432ffb3907eda", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "PATCH /databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}" + "operation": "PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}" }, - "description": "Operation PATCH /databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key} marked deprecated.", + "description": "Operation PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key} marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1longtext~1{key}/patch/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.updateLongtextColumn\",\"since\":\"1.8.0\"}", @@ -169,19 +169,19 @@ }, { "id": 9, - "fingerprint": "sha256:e4196475da31bde80bb82de02202a3b1da92e663361e29421bfa89e7b7f8c09e", + "fingerprint": "sha256:4b28a490587c56b3f30f5b3844c446c6d60478ed97a50ce493008d6029fd227d", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "POST /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext" + "operation": "POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext" }, - "description": "Operation POST /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext marked deprecated.", + "description": "Operation POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1mediumtext/post/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.createMediumtextColumn\",\"since\":\"1.8.0\"}", @@ -190,19 +190,19 @@ }, { "id": 10, - "fingerprint": "sha256:5a51623a86b22252bcbaebedeaa77a4608e2b9a7684aae47f2b1d1775e063b35", + "fingerprint": "sha256:e9c2b62e2a2bccb4bd59086afa866d78677672411a2b6920f985dc4113114cfd", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "PATCH /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}" + "operation": "PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}" }, - "description": "Operation PATCH /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key} marked deprecated.", + "description": "Operation PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key} marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1mediumtext~1{key}/patch/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.updateMediumtextColumn\",\"since\":\"1.8.0\"}", @@ -211,19 +211,19 @@ }, { "id": 11, - "fingerprint": "sha256:2d856b5de3c85083113531289e288e2d885df35a33e788fe924cd3eca713c6af", + "fingerprint": "sha256:e92c6dfc51cf7a10d88b4f5dc3896e3dd868de37aab652c41a314069efbb78a2", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "POST /databases/{databaseId}/collections/{collectionId}/attributes/text" + "operation": "POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/text" }, - "description": "Operation POST /databases/{databaseId}/collections/{collectionId}/attributes/text marked deprecated.", + "description": "Operation POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/text marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1text/post/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.createTextColumn\",\"since\":\"1.8.0\"}", @@ -232,19 +232,19 @@ }, { "id": 12, - "fingerprint": "sha256:630f92b0380411ade789ccd99a285702729de139c849722c24161b62439ecaca", + "fingerprint": "sha256:c6bba24ed542441ae24f495755a312c0580f8ba53decb9d6081b891ba111eaac", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "PATCH /databases/{databaseId}/collections/{collectionId}/attributes/text/{key}" + "operation": "PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/text/{key}" }, - "description": "Operation PATCH /databases/{databaseId}/collections/{collectionId}/attributes/text/{key} marked deprecated.", + "description": "Operation PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/text/{key} marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1text~1{key}/patch/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.updateTextColumn\",\"since\":\"1.8.0\"}", @@ -253,19 +253,19 @@ }, { "id": 13, - "fingerprint": "sha256:c83df968cf8a2a630a01992691e82973bcd990a54e3d9363721d12d7c89d41a9", + "fingerprint": "sha256:6f3460c2f466b54ae261e54c7cffecfc0528a63f5f735e15e95bdda6458fcc10", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "POST /databases/{databaseId}/collections/{collectionId}/attributes/varchar" + "operation": "POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/varchar" }, - "description": "Operation POST /databases/{databaseId}/collections/{collectionId}/attributes/varchar marked deprecated.", + "description": "Operation POST /v1/databases/{databaseId}/collections/{collectionId}/attributes/varchar marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1varchar/post/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.createVarcharColumn\",\"since\":\"1.8.0\"}", @@ -274,19 +274,19 @@ }, { "id": 14, - "fingerprint": "sha256:2d470fd05117935022c3e99f8524b722ac1f496d7777010e8b2fda4aa8a2ddf8", + "fingerprint": "sha256:f930964ce5dc6078a8405d9b9d6472e739f13457be24e46b0f5b54e48e1b780d", "api": "appwrite", - "version": "1.9.5", - "previous_version": "1.9.5", + "version": "2026-06-24", + "previous_version": "2026-06-19", "change_type": "deprecation", "breaking": false, "subject": { "type": "api_operation", "kind": "operation", "side": "request", - "operation": "PATCH /databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}" + "operation": "PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}" }, - "description": "Operation PATCH /databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key} marked deprecated.", + "description": "Operation PATCH /v1/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key} marked deprecated.", "source_url": "https://raw.githubusercontent.com/appwrite/specs/7d74bf9f3c0c990745e822f5935bcfaca310fd06/specs/1.9.x/open-api3-1.9.x-server.json", "source_pointer": "/paths/~1databases~1{databaseId}~1collections~1{collectionId}~1attributes~1varchar~1{key}/patch/x-appwrite/deprecated", "source_excerpt": "{\"replaceWith\":\"tablesDB.updateVarcharColumn\",\"since\":\"1.8.0\"}", diff --git a/providers/appwrite.md b/providers/appwrite.md index b3c283c..24cb211 100644 --- a/providers/appwrite.md +++ b/providers/appwrite.md @@ -26,24 +26,25 @@ Format plugin: `openapi` (`plugins/openapi`), with `adapter.Appwrite`. - **The layout changed once.** Up to 1.9.x a directory has one document per platform (`-client`, `-console`, `-server`); from 2.0.x there's one document, each operation listing its platforms in `x-appwrite.platforms` (2.3.x and 2.4.x also have the per-platform files). The adapter reads the single document when there is one and keeps the operations on `server`. At `0ccd20ab` (1.9.x and 2.0.x) and `98cc1a25` (2.4.x's two) that gives the operations the server document has. Where they part, the single document is the one kept up: `06e6fafa` changed 2.4.x's single document only. - **The `deprecated` flag marks two things.** A route Appwrite wants callers off (the legacy Databases API, replaced by TablesDB in 1.8.0). Or an SDK method name renamed while the route stays: `POST /account/mfa/challenges` is flagged with `"replaceWith": "account.createMFAChallenge"`, which is the same operation's other name in `x-appwrite.methods` (`createMfaChallenge` became `createMFAChallenge`). 23 of the 99 operations flagged in 2.7.x's server operations are renames. All 23 have been flagged since 1.8.0, and 1.8.x's server spec at `ac705cd3` has the same 23. - **`since` isn't a date and isn't when the flag came.** The 14 flags added on 2026-06-24 all say `"since": "1.8.0"`, in a spec whose `info.version` was 1.9.5. It's quoted, not used. -- **The event's `version` is the spec's `info.version`**, the Appwrite server version it describes (`1.9.5`). That's also the version the server SDKs send as `X-Appwrite-Response-Format` (`2.7.2` in node-appwrite 32.0.0 and the Python SDK 28.0.0). +- **The event's `version` is the date of the spec commit** (UTC, `2026-06-24`), not the spec's `info.version` (the server version, `1.9.5`). A repo pins an SDK, and the SDKs are versioned on their own: node-appwrite 32.0.0 and the Python SDK 28.0.0 both send `X-Appwrite-Response-Format: 2.7.2`. A server version can't be placed against that pin, and spec commits don't line up with server releases anyway. The server version is in the event's source, the spec at that commit. +- **Every server URL ends in `/v1`** (`https://cloud.appwrite.io/v1` and the regional `https://{region}.cloud.appwrite.io/v1`, `` up to 1.8.x), at every commit read; the paths don't repeat it. The adapter moves `/v1` into the paths (`adapter.ServerBasePath`), so an operation is named by the path a caller sends, `POST /v1/databases/transactions`; each event's `source_pointer` names the path as published. ## What the plugin reads and ignores - **Reads:** the newest minor's server operations at the newest commit, diffed against the last ones seen. One kind of event comes out: **deprecations**, an operation that gains the `deprecated` flag. The event quotes `x-appwrite.deprecated` (since and replaceWith), which is where the spec says what to use instead; descriptions don't say. Quoting the whole operation could lose it to the 2,000-character cut, because `x-appwrite` sorts last. - **Matches operations by path template**, as the other specs do. - **Ignores:** - - **SDK method renames.** A flag whose `replaceWith` names a method of the same operation's `x-appwrite.methods` isn't read as a deprecation (`diff.Options.FlagNotDeprecation`). If such an operation is later deprecated for another operation, that's an event then. From 1.7.x to 1.8.x (both at `ac705cd3`) this leaves out 21 of the 71 new flags. The other 50 are the Databases API's deprecations in favor of TablesDB. + - **SDK method deprecations.** A flag whose `replaceWith` names a method of the same operation's `x-appwrite.methods`, or on an operation with a method in `x-appwrite.methods` that isn't itself deprecated (a live SDK method remains), isn't read as a deprecation (`diff.Options.FlagNotDeprecation`). An operation with no methods listed (`"methods": []`, as the 14 below) is read by its flag. In 2.7.x the two rules pick the same 23 operations. If such an operation is later deprecated for another operation, that's an event then. From 1.7.x to 1.8.x (both at `ac705cd3`) this leaves out 21 of the 71 new flags. The other 50 are the Databases API's deprecations in favor of TablesDB. - **Removals, all of them,** even of deprecated operations. Read as the plugin reads it (139 commits on `main`), 78 operations left the server operations (from the spec, or from the `server` platform). Only one had been flagged first, and it was a path move: `PATCH .../attributes/{key}/relationship` became `.../attributes/relationship/{key}` on 2026-03-20. 13 are back now: on 2026-10-12, `06e6fafa` took `server` off 13 operations of 2.4.x's single document ("listed server and client methods no released SDK ships yet"), and 2.5.x had them on `server` again the next day. Nothing in the spec says when an operation stops answering. - **Request and response property changes, and new operations.** -- Over the 139 commits this keeps 14 events, all on 2026-06-24 (`7d74bf9f`): the six `/databases/transactions` operations and the `longtext`, `mediumtext`, `text` and `varchar` attribute operations, each replaced by a `tablesDB` method. None is a rename, so the filter drops none of them. -- **Replays** a pair of commits (`Replay`, as the golden test does from `8c00ba35` to `7d74bf9f`). A tag can name an older minor's directory, `1.7.x@`, as the rename test does. The pinned drop test is the 2.4.x pair (13 removals, no event). +- Over the 139 commits this keeps 14 events, all on 2026-06-24 (`7d74bf9f`): the six `/v1/databases/transactions` operations and the `longtext`, `mediumtext`, `text` and `varchar` attribute operations, each replaced by a `tablesDB` method. None is a rename or has a live method, so the filter drops none of them. +- **Replays** a pair of commits (`Replay`, as the golden test does from `8c00ba35` to `7d74bf9f`). A tag can name an older minor's directory, `1.7.x@`, as the rename test does. The pinned drop test is the 2.4.x pair (13 removals, no event). A single document where no operation is on `server` (the platforms gone or renamed) fails the fetch, rather than read as nothing deprecated. ## Known gaps - **Removals aren't events.** The spec doesn't mark them first, so real ones are missed. The SDK changelogs say them ("* Breaking: removed `X`"); a `changelog` plugin per SDK could read them. - **Deprecations from before the plugin's first run aren't events,** nor ones that came with a new minor's directory already flagged. The Databases to TablesDB deprecations of 1.8.0 can be replayed (`1.7.x@` to ``), and a run never sees them. - **The layout changed once (2.0.x) and may again.** The adapter fails, rather than guess, when a directory has neither file. -- **Spec commits aren't releases.** A deprecation's `version` is what the spec says at that commit, which can trail the release. Two commits can share an `info.version` (8c00ba35 and 7d74bf9f are both `1.9.5`), so `previous_version` can equal `version`. +- **Spec commits aren't releases.** A deprecation's `version` is the day the spec changed, which can trail the release. Two commits on one day share a `version`. - **Client and console operations aren't watched.** Only what a server SDK can call. -- **The patch-it client can't place these events against an SDK pin.** It reads an `api_operation` event's `version` as a package version and compares it with the repo's pin. Appwrite's SDKs are versioned on their own (node-appwrite 32.0.0, the Python SDK 28.0.0, both sending `X-Appwrite-Response-Format: 2.7.2`), so a pin on an SDK reads every server version as already passed, and the events are dropped. They're placed right only when the tracked `appwrite` entry pins the server version (`version_range: ">=1.9,<2"`). Otherwise the client needs an SDK release to response-format table, like Stripe's. +- **The patch-it client needs `appwrite` in its list of date-versioned APIs,** as for `neon`, `convex` and `planetscale`. Without it, it reads the date as a package version and drops the event. From fe50539c5f823b93b7fa0408ad1e07ba7abeeba3 Mon Sep 17 00:00:00 2001 From: brandonphelps1212 Date: Thu, 19 Nov 2026 19:51:20 -0500 Subject: [PATCH 3/3] appwrite: accurate known gap about a new minor's directory Co-Authored-By: Claude Opus 5.5 Signed-off-by: brandonphelps1212 --- providers/appwrite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/appwrite.md b/providers/appwrite.md index 24cb211..1b44940 100644 --- a/providers/appwrite.md +++ b/providers/appwrite.md @@ -43,7 +43,7 @@ Format plugin: `openapi` (`plugins/openapi`), with `adapter.Appwrite`. ## Known gaps - **Removals aren't events.** The spec doesn't mark them first, so real ones are missed. The SDK changelogs say them ("* Breaking: removed `X`"); a `changelog` plugin per SDK could read them. -- **Deprecations from before the plugin's first run aren't events,** nor ones that came with a new minor's directory already flagged. The Databases to TablesDB deprecations of 1.8.0 can be replayed (`1.7.x@` to ``), and a run never sees them. +- **Deprecations from before the plugin's first run aren't events,** nor operations that first appear already flagged. When the newest minor changes, the plugin diffs the new directory against the previous minor's last spec, so an operation that was unflagged there and is flagged in the new one is an event. The Databases to TablesDB deprecations of 1.8.0 can be replayed (`1.7.x@` to ``), and a run never sees them. - **The layout changed once (2.0.x) and may again.** The adapter fails, rather than guess, when a directory has neither file. - **Spec commits aren't releases.** A deprecation's `version` is the day the spec changed, which can trail the release. Two commits on one day share a `version`. - **Client and console operations aren't watched.** Only what a server SDK can call.