Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log

## v5.0.0

* Breaking: Removed `githubImagine` and `googleImagine` from `ProjectOAuthProviderId`
* Breaking: Removed `deno-1.21`, `deno-1.24`, and `deno-1.35` from `Runtime` and `BuildRuntime`
* Breaking: Dropped numeric suffixes from `StatusCode` redirect members
* Added: `Organization` service for managing projects and API keys
* Added: `PolicyDenyAliasedEmail`, `PolicyDenyDisposableEmail`, and `PolicyDenyFreeEmail` policy models
* Added: `deny-aliased-email`, `deny-disposable-email`, and `deny-free-email` to `ProjectPolicyId`
* Added: `BrowserTheme`, `HealthQueueName`, `OrganizationKeyScopes`, and `Region` enums
* Added: `dart-3.12` and `flutter-3.44` runtimes
* Added: `ProjectList` model and new attributes on `Function`, `Site`, and `UsageGauge`
* Updated: `functions`, `sites`, `usage`, `health`, and `avatars` services
* Updated: Renamed `updatePresence` to `update` in the `presences` service

## v4.0.0

* Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId`
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go mod init <YOUR_MODULE_NAME>
To install using `go get`:

```bash
go get github.com/appwrite/sdk-for-go/v4
go get github.com/appwrite/sdk-for-go/v5
```

## Testing the SDK
Expand Down Expand Up @@ -51,8 +51,8 @@ go get github.com/appwrite/sdk-for-go/v4
"os"
"time"

"github.com/appwrite/sdk-for-go/v4/appwrite"
"github.com/appwrite/sdk-for-go/v4/id"
"github.com/appwrite/sdk-for-go/v5/appwrite"
"github.com/appwrite/sdk-for-go/v5/id"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package account
import (
"encoding/json"
"errors"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/models"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/models"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion account/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v5/client"
)

func TestAccount(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions activities/activities.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package activities
import (
"encoding/json"
"errors"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/models"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/models"
"strings"
)

Expand Down
18 changes: 9 additions & 9 deletions activities/activities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v5/client"
)

func TestActivities(t *testing.T) {
Expand All @@ -23,10 +23,10 @@ func TestActivities(t *testing.T) {
"events": [
{
"$id": "5e5ea5c16897e",
"userType": "user",
"userId": "610fc2f985ee0",
"userEmail": "john@appwrite.io",
"userName": "John Doe",
"actorType": "user",
"actorId": "610fc2f985ee0",
"actorEmail": "john@appwrite.io",
"actorName": "John Doe",
"resourceParent": "database/ID",
"resourceType": "collection",
"resourceId": "610fc2f985ee0",
Expand Down Expand Up @@ -82,10 +82,10 @@ func TestActivities(t *testing.T) {
mockResponse := `
{
"$id": "5e5ea5c16897e",
"userType": "user",
"userId": "610fc2f985ee0",
"userEmail": "john@appwrite.io",
"userName": "John Doe",
"actorType": "user",
"actorId": "610fc2f985ee0",
"actorEmail": "john@appwrite.io",
"actorName": "John Doe",
"resourceParent": "database/ID",
"resourceType": "collection",
"resourceId": "610fc2f985ee0",
Expand Down
4 changes: 2 additions & 2 deletions advisor/advisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package advisor
import (
"encoding/json"
"errors"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/models"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/models"
"strings"
)

Expand Down
10 changes: 5 additions & 5 deletions advisor/advisor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v5/client"
)

func TestAdvisor(t *testing.T) {
Expand Down Expand Up @@ -46,7 +46,7 @@ func TestAdvisor(t *testing.T) {
"parentResourceType": "tables",
"parentResourceId": "orders",
"title": "Missing index on collection orders",
"summary": "Queries against `orders.status` are scanning the full collection.",
"summary": "Queries against \u0060orders.status\u0060 are scanning the full collection.",
"ctas": [
{
"label": "Create missing index",
Expand Down Expand Up @@ -108,7 +108,7 @@ func TestAdvisor(t *testing.T) {
"parentResourceType": "tables",
"parentResourceId": "orders",
"title": "Missing index on collection orders",
"summary": "Queries against `orders.status` are scanning the full collection.",
"summary": "Queries against \u0060orders.status\u0060 are scanning the full collection.",
"ctas": [
{
"label": "Create missing index",
Expand Down Expand Up @@ -185,7 +185,7 @@ func TestAdvisor(t *testing.T) {
"parentResourceType": "tables",
"parentResourceId": "orders",
"title": "Missing index on collection orders",
"summary": "Queries against `orders.status` are scanning the full collection.",
"summary": "Queries against \u0060orders.status\u0060 are scanning the full collection.",
"ctas": [
{
"label": "Create missing index",
Expand Down Expand Up @@ -233,7 +233,7 @@ func TestAdvisor(t *testing.T) {
"parentResourceType": "tables",
"parentResourceId": "orders",
"title": "Missing index on collection orders",
"summary": "Queries against `orders.status` are scanning the full collection.",
"summary": "Queries against \u0060orders.status\u0060 are scanning the full collection.",
"ctas": [
{
"label": "Create missing index",
Expand Down
50 changes: 27 additions & 23 deletions appwrite/appwrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@ package appwrite
import (
"time"

"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/account"
"github.com/appwrite/sdk-for-go/v4/activities"
"github.com/appwrite/sdk-for-go/v4/avatars"
"github.com/appwrite/sdk-for-go/v4/backups"
"github.com/appwrite/sdk-for-go/v4/databases"
"github.com/appwrite/sdk-for-go/v4/functions"
"github.com/appwrite/sdk-for-go/v4/graphql"
"github.com/appwrite/sdk-for-go/v4/health"
"github.com/appwrite/sdk-for-go/v4/locale"
"github.com/appwrite/sdk-for-go/v4/messaging"
"github.com/appwrite/sdk-for-go/v4/presences"
"github.com/appwrite/sdk-for-go/v4/project"
"github.com/appwrite/sdk-for-go/v4/proxy"
"github.com/appwrite/sdk-for-go/v4/advisor"
"github.com/appwrite/sdk-for-go/v4/sites"
"github.com/appwrite/sdk-for-go/v4/storage"
"github.com/appwrite/sdk-for-go/v4/tablesdb"
"github.com/appwrite/sdk-for-go/v4/teams"
"github.com/appwrite/sdk-for-go/v4/tokens"
"github.com/appwrite/sdk-for-go/v4/usage"
"github.com/appwrite/sdk-for-go/v4/users"
"github.com/appwrite/sdk-for-go/v4/webhooks"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/account"
"github.com/appwrite/sdk-for-go/v5/activities"
"github.com/appwrite/sdk-for-go/v5/avatars"
"github.com/appwrite/sdk-for-go/v5/backups"
"github.com/appwrite/sdk-for-go/v5/databases"
"github.com/appwrite/sdk-for-go/v5/functions"
"github.com/appwrite/sdk-for-go/v5/graphql"
"github.com/appwrite/sdk-for-go/v5/health"
"github.com/appwrite/sdk-for-go/v5/locale"
"github.com/appwrite/sdk-for-go/v5/messaging"
"github.com/appwrite/sdk-for-go/v5/organization"
"github.com/appwrite/sdk-for-go/v5/presences"
"github.com/appwrite/sdk-for-go/v5/project"
"github.com/appwrite/sdk-for-go/v5/proxy"
"github.com/appwrite/sdk-for-go/v5/advisor"
"github.com/appwrite/sdk-for-go/v5/sites"
"github.com/appwrite/sdk-for-go/v5/storage"
"github.com/appwrite/sdk-for-go/v5/tablesdb"
"github.com/appwrite/sdk-for-go/v5/teams"
"github.com/appwrite/sdk-for-go/v5/tokens"
"github.com/appwrite/sdk-for-go/v5/usage"
"github.com/appwrite/sdk-for-go/v5/users"
"github.com/appwrite/sdk-for-go/v5/webhooks"
)

func NewAccount(clt client.Client) *account.Account {
Expand Down Expand Up @@ -58,6 +59,9 @@ func NewLocale(clt client.Client) *locale.Locale {
func NewMessaging(clt client.Client) *messaging.Messaging {
return messaging.New(clt)
}
func NewOrganization(clt client.Client) *organization.Organization {
return organization.New(clt)
}
func NewPresences(clt client.Client) *presences.Presences {
return presences.New(clt)
}
Expand Down
2 changes: 1 addition & 1 deletion avatars/avatars.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package avatars
import (
"encoding/json"
"errors"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v5/client"
"net/url"
"fmt"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion avatars/avatars_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v5/client"
)

func TestAvatars(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions backups/backups.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package backups
import (
"encoding/json"
"errors"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/models"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/models"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion backups/backups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v5/client"
)

func TestBackups(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"time"
"runtime"

"github.com/appwrite/sdk-for-go/v4/file"
"github.com/appwrite/sdk-for-go/v5/file"
)

const (
Expand Down Expand Up @@ -74,11 +74,11 @@ type Client struct {
func New(optionalSetters ...ClientOption) Client {
headers := map[string]string{
"X-Appwrite-Response-Format" : "1.9.5",
"user-agent" : fmt.Sprintf("AppwriteGoSDK/v4.1.0 (%s; %s)", runtime.GOOS, runtime.GOARCH),
"user-agent" : fmt.Sprintf("AppwriteGoSDK/v5.0.0 (%s; %s)", runtime.GOOS, runtime.GOARCH),
"x-sdk-name": "Go",
"x-sdk-platform": "server",
"x-sdk-language": "go",
"x-sdk-version": "v4.1.0",
"x-sdk-version": "v5.0.0",
}
httpClient, err := GetDefaultClient(defaultTimeout)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions databases/databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package databases
import (
"encoding/json"
"errors"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/models"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/models"
"fmt"
"strings"
)
Expand Down
4 changes: 2 additions & 2 deletions databases/databases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http/httptest"
"testing"

"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/models"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/models"
)

func TestDatabases(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main

import (
"fmt"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/account"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/account"
)

client := client.New(
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main

import (
"fmt"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/account"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/account"
)

client := client.New(
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main

import (
"fmt"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/account"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/account"
)

client := client.New(
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-email-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main

import (
"fmt"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/account"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/account"
)

client := client.New(
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main

import (
"fmt"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/account"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/account"
)

client := client.New(
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main

import (
"fmt"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/account"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/account"
)

client := client.New(
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main

import (
"fmt"
"github.com/appwrite/sdk-for-go/v4/client"
"github.com/appwrite/sdk-for-go/v4/account"
"github.com/appwrite/sdk-for-go/v5/client"
"github.com/appwrite/sdk-for-go/v5/account"
)

client := client.New(
Expand Down
Loading