Skip to content

Commit adc49ac

Browse files
authored
Merge pull request #52 from appwrite/dev
2 parents c48e847 + 5cfc290 commit adc49ac

36 files changed

Lines changed: 1803 additions & 327 deletions

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## v2.0.0
4+
5+
* [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents
6+
* Added `NewProject` and `NewWebhooks` client constructors
7+
* Added impersonation helpers `WithImpersonateUserId`, `WithImpersonateUserEmail`, `WithImpersonateUserPhone`
8+
* Added avatar URL helpers: `GetBrowserURL`, `GetCreditCardURL`, `GetFaviconURL`, `GetFlagURL`, `GetImageURL`, `GetInitialsURL`, `GetQRURL`, `GetScreenshotURL`
9+
* Updated README badge to API version 1.9.0
10+
311
## v1.0.0
412

513
* Breaking: Activate parameter was removed from CreateDeployment; use WithCreateDeploymentActivate.
@@ -8,7 +16,7 @@
816
* Added: TTL option to list operations for documents and rows.
917
* Updated: Document and Row sequence comments to reflect sequence IDs.
1018

11-
## 0.17.0
19+
## v0.17.0
1220

1321
* Added new Activities service to the Go SDK with a NewActivities constructor to access Activities endpoints.
1422
* Extended Databases attribute APIs to support encryption: introduced Encrypt option for Longtext, Mediumtext, Text, and Varchar attributes, along with corresponding New/Create option builders (WithCreateLongtextAttributeEncrypt, WithCreateMediumtextAttributeEncrypt, WithCreateTextAttributeEncrypt, WithCreateVarcharAttributeEncrypt) and wiring to send the encrypt parameter when enabled.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Appwrite Go SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-go.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.9.0-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-go/releases).**
9+
**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-go/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Go SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

appwrite/appwrite.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ import (
1414
"github.com/appwrite/sdk-for-go/health"
1515
"github.com/appwrite/sdk-for-go/locale"
1616
"github.com/appwrite/sdk-for-go/messaging"
17+
"github.com/appwrite/sdk-for-go/project"
1718
"github.com/appwrite/sdk-for-go/sites"
1819
"github.com/appwrite/sdk-for-go/storage"
1920
"github.com/appwrite/sdk-for-go/tablesdb"
2021
"github.com/appwrite/sdk-for-go/teams"
2122
"github.com/appwrite/sdk-for-go/tokens"
2223
"github.com/appwrite/sdk-for-go/users"
24+
"github.com/appwrite/sdk-for-go/webhooks"
2325
)
2426

2527
func NewAccount(clt client.Client) *account.Account {
@@ -52,6 +54,9 @@ func NewLocale(clt client.Client) *locale.Locale {
5254
func NewMessaging(clt client.Client) *messaging.Messaging {
5355
return messaging.New(clt)
5456
}
57+
func NewProject(clt client.Client) *project.Project {
58+
return project.New(clt)
59+
}
5560
func NewSites(clt client.Client) *sites.Sites {
5661
return sites.New(clt)
5762
}
@@ -70,6 +75,9 @@ func NewTokens(clt client.Client) *tokens.Tokens {
7075
func NewUsers(clt client.Client) *users.Users {
7176
return users.New(clt)
7277
}
78+
func NewWebhooks(clt client.Client) *webhooks.Webhooks {
79+
return webhooks.New(clt)
80+
}
7381

7482
// NewClient initializes a new Appwrite client with a given timeout
7583
func NewClient(optionalSetters ...client.ClientOption) client.Client {
@@ -167,3 +175,30 @@ func WithForwardedUserAgent(value string) client.ClientOption {
167175
return nil
168176
}
169177
}
178+
// Helper method to construct NewClient()
179+
//
180+
// Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.
181+
func WithImpersonateUserId(value string) client.ClientOption {
182+
return func(clt *client.Client) error {
183+
clt.Headers["X-Appwrite-Impersonate-User-Id"] = value
184+
return nil
185+
}
186+
}
187+
// Helper method to construct NewClient()
188+
//
189+
// Impersonate a user by email on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.
190+
func WithImpersonateUserEmail(value string) client.ClientOption {
191+
return func(clt *client.Client) error {
192+
clt.Headers["X-Appwrite-Impersonate-User-Email"] = value
193+
return nil
194+
}
195+
}
196+
// Helper method to construct NewClient()
197+
//
198+
// Impersonate a user by phone on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.
199+
func WithImpersonateUserPhone(value string) client.ClientOption {
200+
return func(clt *client.Client) error {
201+
clt.Headers["X-Appwrite-Impersonate-User-Phone"] = value
202+
return nil
203+
}
204+
}

0 commit comments

Comments
 (0)