react-native-appwrite 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +13 -4
- package/CHANGELOG.md +1 -1
- package/LICENSE +1 -1
- package/README.md +22 -9
- package/dist/cjs/sdk.js +1196 -273
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1196 -273
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-anonymous-session.md +6 -13
- package/docs/examples/account/create-email-password-session.md +14 -0
- package/docs/examples/account/create-email-token.md +15 -0
- package/docs/examples/account/create-j-w-t.md +6 -13
- package/docs/examples/account/create-magic-u-r-l-token.md +16 -0
- package/docs/examples/account/create-mfa-authenticator.md +13 -0
- package/docs/examples/account/create-mfa-challenge.md +13 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/create-o-auth2session.md +10 -9
- package/docs/examples/account/create-o-auth2token.md +15 -0
- package/docs/examples/account/create-phone-token.md +14 -0
- package/docs/examples/account/create-phone-verification.md +6 -13
- package/docs/examples/account/create-push-target.md +15 -0
- package/docs/examples/account/create-recovery.md +9 -13
- package/docs/examples/account/create-session.md +14 -0
- package/docs/examples/account/create-verification.md +8 -13
- package/docs/examples/account/create.md +11 -13
- package/docs/examples/account/delete-identity.md +8 -13
- package/docs/examples/account/delete-mfa-authenticator.md +14 -0
- package/docs/examples/account/delete-push-target.md +13 -0
- package/docs/examples/account/delete-session.md +8 -13
- package/docs/examples/account/delete-sessions.md +6 -13
- package/docs/examples/account/get-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/get-prefs.md +6 -13
- package/docs/examples/account/get-session.md +8 -13
- package/docs/examples/account/get.md +6 -13
- package/docs/examples/account/list-identities.md +8 -13
- package/docs/examples/account/list-logs.md +8 -13
- package/docs/examples/account/list-mfa-factors.md +11 -0
- package/docs/examples/account/list-sessions.md +6 -13
- package/docs/examples/account/update-email.md +9 -13
- package/docs/examples/account/update-m-f-a.md +13 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +9 -13
- package/docs/examples/account/update-mfa-authenticator.md +14 -0
- package/docs/examples/account/update-mfa-challenge.md +14 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/update-name.md +8 -13
- package/docs/examples/account/update-password.md +9 -13
- package/docs/examples/account/update-phone-session.md +9 -13
- package/docs/examples/account/update-phone-verification.md +9 -13
- package/docs/examples/account/update-phone.md +9 -13
- package/docs/examples/account/update-prefs.md +8 -13
- package/docs/examples/account/update-push-target.md +14 -0
- package/docs/examples/account/update-recovery.md +10 -13
- package/docs/examples/account/update-session.md +8 -13
- package/docs/examples/account/update-status.md +6 -13
- package/docs/examples/account/update-verification.md +9 -13
- package/docs/examples/avatars/get-browser.md +11 -9
- package/docs/examples/avatars/get-credit-card.md +11 -9
- package/docs/examples/avatars/get-favicon.md +8 -9
- package/docs/examples/avatars/get-flag.md +11 -9
- package/docs/examples/avatars/get-image.md +10 -9
- package/docs/examples/avatars/get-initials.md +11 -9
- package/docs/examples/avatars/get-q-r.md +11 -9
- package/docs/examples/databases/create-document.md +12 -13
- package/docs/examples/databases/delete-document.md +10 -13
- package/docs/examples/databases/get-document.md +11 -13
- package/docs/examples/databases/list-documents.md +10 -13
- package/docs/examples/databases/update-document.md +12 -13
- package/docs/examples/functions/create-execution.md +13 -13
- package/docs/examples/functions/get-execution.md +9 -13
- package/docs/examples/functions/list-executions.md +10 -13
- package/docs/examples/graphql/mutation.md +8 -13
- package/docs/examples/graphql/query.md +8 -13
- package/docs/examples/locale/get.md +6 -13
- package/docs/examples/locale/list-codes.md +6 -13
- package/docs/examples/locale/list-continents.md +6 -13
- package/docs/examples/locale/list-countries-e-u.md +6 -13
- package/docs/examples/locale/list-countries-phones.md +6 -13
- package/docs/examples/locale/list-countries.md +6 -13
- package/docs/examples/locale/list-currencies.md +6 -13
- package/docs/examples/locale/list-languages.md +6 -13
- package/docs/examples/messaging/create-subscriber.md +15 -0
- package/docs/examples/messaging/delete-subscriber.md +14 -0
- package/docs/examples/storage/create-file.md +11 -13
- package/docs/examples/storage/delete-file.md +9 -13
- package/docs/examples/storage/get-file-download.md +9 -9
- package/docs/examples/storage/get-file-preview.md +20 -9
- package/docs/examples/storage/get-file-view.md +9 -9
- package/docs/examples/storage/get-file.md +9 -13
- package/docs/examples/storage/list-files.md +10 -13
- package/docs/examples/storage/update-file.md +11 -13
- package/docs/examples/teams/create-membership.md +14 -13
- package/docs/examples/teams/create.md +10 -13
- package/docs/examples/teams/delete-membership.md +9 -13
- package/docs/examples/teams/delete.md +8 -13
- package/docs/examples/teams/get-membership.md +9 -13
- package/docs/examples/teams/get-prefs.md +8 -13
- package/docs/examples/teams/get.md +8 -13
- package/docs/examples/teams/list-memberships.md +10 -13
- package/docs/examples/teams/list.md +9 -13
- package/docs/examples/teams/update-membership-status.md +11 -13
- package/docs/examples/teams/update-membership.md +10 -13
- package/docs/examples/teams/update-name.md +9 -13
- package/docs/examples/teams/update-prefs.md +9 -13
- package/package.json +4 -3
- package/src/client.ts +39 -13
- package/src/enums/authentication-factor.ts +6 -0
- package/src/enums/authenticator-type.ts +3 -0
- package/src/enums/browser.ts +16 -0
- package/src/enums/credit-card.ts +18 -0
- package/src/enums/execution-method.ts +8 -0
- package/src/enums/flag.ts +197 -0
- package/src/enums/image-format.ts +7 -0
- package/src/enums/image-gravity.ts +11 -0
- package/src/enums/o-auth-provider.ts +41 -0
- package/src/id.ts +23 -4
- package/src/index.ts +13 -2
- package/src/models.ts +174 -0
- package/src/query.ts +61 -34
- package/src/service.ts +4 -7
- package/src/services/account.ts +643 -119
- package/src/services/avatars.ts +12 -6
- package/src/services/databases.ts +7 -4
- package/src/services/functions.ts +6 -2
- package/src/services/graphql.ts +3 -0
- package/src/services/locale.ts +3 -0
- package/src/services/messaging.ts +84 -0
- package/src/services/storage.ts +13 -7
- package/src/services/teams.ts +3 -0
- package/docs/examples/account/create-email-session.md +0 -18
- package/docs/examples/account/create-magic-u-r-l-session.md +0 -18
- package/docs/examples/account/create-phone-session.md +0 -18
|
@@ -4,7 +4,6 @@ on:
|
|
|
4
4
|
release:
|
|
5
5
|
types: [published]
|
|
6
6
|
workflow_dispatch:
|
|
7
|
-
|
|
8
7
|
|
|
9
8
|
jobs:
|
|
10
9
|
publish:
|
|
@@ -20,14 +19,24 @@ jobs:
|
|
|
20
19
|
node-version: '20.x'
|
|
21
20
|
registry-url: 'https://registry.npmjs.org'
|
|
22
21
|
|
|
22
|
+
# Determine release tag based on the tag name
|
|
23
|
+
- name: Determine release tag
|
|
24
|
+
id: release_tag
|
|
25
|
+
run: |
|
|
26
|
+
if [[ "${{ github.ref }}" == *"-rc"* ]] || [[ "${{ github.ref }}" == *"-RC"* ]]; then
|
|
27
|
+
echo "tag=next" >> "$GITHUB_OUTPUT"
|
|
28
|
+
else
|
|
29
|
+
echo "tag=latest" >> "$GITHUB_OUTPUT"
|
|
30
|
+
fi
|
|
31
|
+
|
|
23
32
|
# Install dependencies (if any) and build your project (if necessary)
|
|
24
33
|
- name: Install dependencies and build
|
|
25
34
|
run: |
|
|
26
35
|
npm install
|
|
27
36
|
npm run build
|
|
28
37
|
|
|
29
|
-
# Publish to NPM
|
|
38
|
+
# Publish to NPM with the appropriate tag
|
|
30
39
|
- name: Publish
|
|
31
|
-
run: npm publish
|
|
40
|
+
run: npm publish --tag ${{ steps.release_tag.outputs.tag }}
|
|
32
41
|
env:
|
|
33
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
42
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# Change
|
|
1
|
+
# Change log
|
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c)
|
|
1
|
+
Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors.
|
|
2
2
|
All rights reserved.
|
|
3
3
|
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# Appwrite React Native SDK
|
|
1
|
+
# Appwrite React Native SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
[](https://travis-ci.com/appwrite/sdk-generator)
|
|
6
6
|
[](https://twitter.com/appwrite)
|
|
7
7
|
[](https://appwrite.io/discord)
|
|
8
8
|
|
|
9
|
-
**This SDK is compatible with Appwrite server version 1.
|
|
9
|
+
**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-react-native/releases).**
|
|
10
10
|
|
|
11
11
|
Appwrite is an open-source backend as a service server that abstract and simplify 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 React Native 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)
|
|
12
12
|
|
|
@@ -20,6 +20,8 @@ To install
|
|
|
20
20
|
npx expo install react-native-appwrite react-native-url-polyfill
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
|
|
24
|
+
|
|
23
25
|
## Getting Started
|
|
24
26
|
|
|
25
27
|
### Add your Platform
|
|
@@ -28,19 +30,28 @@ If this is your first time using Appwrite, create an account and create your fir
|
|
|
28
30
|
Then, under **Add a platform**, add a **Android app** or a **Apple app**. You can skip optional steps.
|
|
29
31
|
|
|
30
32
|
#### iOS steps
|
|
31
|
-
Add your app **name** and **Bundle ID**. You can find your **Bundle Identifier** in the **General** tab for your app's primary target in XCode.
|
|
33
|
+
Add your app **name** and **Bundle ID**. You can find your **Bundle Identifier** in the **General** tab for your app's primary target in XCode. For Expo projects you can set or find it on **app.json** file at your project's root directory.
|
|
32
34
|
|
|
33
35
|
#### Android steps
|
|
34
|
-
Add your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level
|
|
36
|
+
Add your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level **build.gradle** file. For Expo projects you can set or find it on **app.json** file at your project's root directory.
|
|
35
37
|
|
|
36
38
|
## Setup
|
|
37
39
|
|
|
40
|
+
On `index.js` add import for `react-native-url-polyfill`
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
import 'react-native-url-polyfill/auto'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> If you are building for iOS, don't forget to install pods
|
|
47
|
+
> `cd ios && pod install && cd ..`
|
|
48
|
+
|
|
38
49
|
### Init your SDK
|
|
39
50
|
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page.
|
|
40
51
|
|
|
41
52
|
```js
|
|
42
53
|
import { Client } from 'react-native-appwrite';
|
|
43
|
-
// Init your
|
|
54
|
+
// Init your React Native SDK
|
|
44
55
|
const client = new Client();
|
|
45
56
|
|
|
46
57
|
client
|
|
@@ -63,12 +74,13 @@ account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')
|
|
|
63
74
|
}, function (error) {
|
|
64
75
|
console.log(error);
|
|
65
76
|
});
|
|
77
|
+
|
|
66
78
|
```
|
|
67
79
|
|
|
68
80
|
### Full Example
|
|
69
81
|
```js
|
|
70
82
|
import { Client, Account } from 'react-native-appwrite';
|
|
71
|
-
// Init your
|
|
83
|
+
// Init your React Native SDK
|
|
72
84
|
const client = new Client();
|
|
73
85
|
|
|
74
86
|
client
|
|
@@ -95,9 +107,10 @@ You can use the following resources to learn more and get help
|
|
|
95
107
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
|
96
108
|
- 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native)
|
|
97
109
|
|
|
98
|
-
|
|
99
110
|
## Contribution
|
|
111
|
+
|
|
100
112
|
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
|
|
101
113
|
|
|
102
114
|
## License
|
|
103
|
-
|
|
115
|
+
|
|
116
|
+
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
|