react-native-appwrite 0.3.0 → 0.3.1

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-native-appwrite",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "0.3.0",
5
+ "version": "0.3.1",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
@@ -0,0 +1,133 @@
1
+ import { Models } from './models';
2
+ declare type Payload = {
3
+ [key: string]: any;
4
+ };
5
+ declare type Headers = {
6
+ [key: string]: string;
7
+ };
8
+ export declare type RealtimeResponseEvent<T extends unknown> = {
9
+ events: string[];
10
+ channels: string[];
11
+ timestamp: number;
12
+ payload: T;
13
+ };
14
+ export declare type UploadProgress = {
15
+ $id: string;
16
+ progress: number;
17
+ sizeUploaded: number;
18
+ chunksTotal: number;
19
+ chunksUploaded: number;
20
+ };
21
+ declare class AppwriteException extends Error {
22
+ code: number;
23
+ response: string;
24
+ type: string;
25
+ constructor(message: string, code?: number, type?: string, response?: string);
26
+ }
27
+ declare class Client {
28
+ config: {
29
+ endpoint: string;
30
+ endpointRealtime: string;
31
+ project: string;
32
+ jwt: string;
33
+ locale: string;
34
+ session: string;
35
+ platform: string;
36
+ };
37
+ headers: Headers;
38
+ /**
39
+ * Set Endpoint
40
+ *
41
+ * Your project endpoint
42
+ *
43
+ * @param {string} endpoint
44
+ *
45
+ * @returns {this}
46
+ */
47
+ setEndpoint(endpoint: string): this;
48
+ /**
49
+ * Set Realtime Endpoint
50
+ *
51
+ * @param {string} endpointRealtime
52
+ *
53
+ * @returns {this}
54
+ */
55
+ setEndpointRealtime(endpointRealtime: string): this;
56
+ /**
57
+ * Set platform
58
+ *
59
+ * Set platform. Will be used as origin for all requests.
60
+ *
61
+ * @param {string} platform
62
+ * @returns {this}
63
+ */
64
+ setPlatform(platform: string): this;
65
+ /**
66
+ * Set Project
67
+ *
68
+ * Your project ID
69
+ *
70
+ * @param value string
71
+ *
72
+ * @return {this}
73
+ */
74
+ setProject(value: string): this;
75
+ /**
76
+ * Set JWT
77
+ *
78
+ * Your secret JSON Web Token
79
+ *
80
+ * @param value string
81
+ *
82
+ * @return {this}
83
+ */
84
+ setJWT(value: string): this;
85
+ /**
86
+ * Set Locale
87
+ *
88
+ * @param value string
89
+ *
90
+ * @return {this}
91
+ */
92
+ setLocale(value: string): this;
93
+ /**
94
+ * Set Session
95
+ *
96
+ * The user session to authenticate with
97
+ *
98
+ * @param value string
99
+ *
100
+ * @return {this}
101
+ */
102
+ setSession(value: string): this;
103
+ private realtime;
104
+ /**
105
+ * Subscribes to Appwrite events and passes you the payload in realtime.
106
+ *
107
+ * @param {string|string[]} channels
108
+ * Channel to subscribe - pass a single channel as a string or multiple with an array of strings.
109
+ *
110
+ * Possible channels are:
111
+ * - account
112
+ * - collections
113
+ * - collections.[ID]
114
+ * - collections.[ID].documents
115
+ * - documents
116
+ * - documents.[ID]
117
+ * - files
118
+ * - files.[ID]
119
+ * - executions
120
+ * - executions.[ID]
121
+ * - functions.[ID]
122
+ * - teams
123
+ * - teams.[ID]
124
+ * - memberships
125
+ * - memberships.[ID]
126
+ * @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update.
127
+ * @returns {() => void} Unsubscribes from events.
128
+ */
129
+ subscribe<T extends unknown>(channels: string | string[], callback: (payload: RealtimeResponseEvent<T>) => void): () => void;
130
+ call(method: string, url: URL, headers?: Headers, params?: Payload): Promise<any>;
131
+ }
132
+ export { Client, AppwriteException };
133
+ export type { Models, Payload };
@@ -0,0 +1,6 @@
1
+ export declare enum AuthenticationFactor {
2
+ Email = "email",
3
+ Phone = "phone",
4
+ Totp = "totp",
5
+ Recoverycode = "recoverycode"
6
+ }
@@ -0,0 +1,3 @@
1
+ export declare enum AuthenticatorType {
2
+ Totp = "totp"
3
+ }
@@ -0,0 +1,16 @@
1
+ export declare enum Browser {
2
+ AvantBrowser = "aa",
3
+ AndroidWebViewBeta = "an",
4
+ GoogleChrome = "ch",
5
+ GoogleChromeIOS = "ci",
6
+ GoogleChromeMobile = "cm",
7
+ Chromium = "cr",
8
+ MozillaFirefox = "ff",
9
+ Safari = "sf",
10
+ MobileSafari = "mf",
11
+ MicrosoftEdge = "ps",
12
+ MicrosoftEdgeIOS = "oi",
13
+ OperaMini = "om",
14
+ Opera = "op",
15
+ OperaNext = "on"
16
+ }
@@ -0,0 +1,18 @@
1
+ export declare enum CreditCard {
2
+ AmericanExpress = "amex",
3
+ Argencard = "argencard",
4
+ Cabal = "cabal",
5
+ Consosud = "censosud",
6
+ DinersClub = "diners",
7
+ Discover = "discover",
8
+ Elo = "elo",
9
+ Hipercard = "hipercard",
10
+ JCB = "jcb",
11
+ Mastercard = "mastercard",
12
+ Naranja = "naranja",
13
+ TarjetaShopping = "targeta-shopping",
14
+ UnionChinaPay = "union-china-pay",
15
+ Visa = "visa",
16
+ MIR = "mir",
17
+ Maestro = "maestro"
18
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum ExecutionMethod {
2
+ GET = "GET",
3
+ POST = "POST",
4
+ PUT = "PUT",
5
+ PATCH = "PATCH",
6
+ DELETE = "DELETE",
7
+ OPTIONS = "OPTIONS"
8
+ }
@@ -0,0 +1,197 @@
1
+ export declare enum Flag {
2
+ Afghanistan = "af",
3
+ Angola = "ao",
4
+ Albania = "al",
5
+ Andorra = "ad",
6
+ UnitedArabEmirates = "ae",
7
+ Argentina = "ar",
8
+ Armenia = "am",
9
+ AntiguaAndBarbuda = "ag",
10
+ Australia = "au",
11
+ Austria = "at",
12
+ Azerbaijan = "az",
13
+ Burundi = "bi",
14
+ Belgium = "be",
15
+ Benin = "bj",
16
+ BurkinaFaso = "bf",
17
+ Bangladesh = "bd",
18
+ Bulgaria = "bg",
19
+ Bahrain = "bh",
20
+ Bahamas = "bs",
21
+ BosniaAndHerzegovina = "ba",
22
+ Belarus = "by",
23
+ Belize = "bz",
24
+ Bolivia = "bo",
25
+ Brazil = "br",
26
+ Barbados = "bb",
27
+ BruneiDarussalam = "bn",
28
+ Bhutan = "bt",
29
+ Botswana = "bw",
30
+ CentralAfricanRepublic = "cf",
31
+ Canada = "ca",
32
+ Switzerland = "ch",
33
+ Chile = "cl",
34
+ China = "cn",
35
+ CoteDIvoire = "ci",
36
+ Cameroon = "cm",
37
+ DemocraticRepublicOfTheCongo = "cd",
38
+ RepublicOfTheCongo = "cg",
39
+ Colombia = "co",
40
+ Comoros = "km",
41
+ CapeVerde = "cv",
42
+ CostaRica = "cr",
43
+ Cuba = "cu",
44
+ Cyprus = "cy",
45
+ CzechRepublic = "cz",
46
+ Germany = "de",
47
+ Djibouti = "dj",
48
+ Dominica = "dm",
49
+ Denmark = "dk",
50
+ DominicanRepublic = "do",
51
+ Algeria = "dz",
52
+ Ecuador = "ec",
53
+ Egypt = "eg",
54
+ Eritrea = "er",
55
+ Spain = "es",
56
+ Estonia = "ee",
57
+ Ethiopia = "et",
58
+ Finland = "fi",
59
+ Fiji = "fj",
60
+ France = "fr",
61
+ MicronesiaFederatedStatesOf = "fm",
62
+ Gabon = "ga",
63
+ UnitedKingdom = "gb",
64
+ Georgia = "ge",
65
+ Ghana = "gh",
66
+ Guinea = "gn",
67
+ Gambia = "gm",
68
+ GuineaBissau = "gw",
69
+ EquatorialGuinea = "gq",
70
+ Greece = "gr",
71
+ Grenada = "gd",
72
+ Guatemala = "gt",
73
+ Guyana = "gy",
74
+ Honduras = "hn",
75
+ Croatia = "hr",
76
+ Haiti = "ht",
77
+ Hungary = "hu",
78
+ Indonesia = "id",
79
+ India = "in",
80
+ Ireland = "ie",
81
+ IranIslamicRepublicOf = "ir",
82
+ Iraq = "iq",
83
+ Iceland = "is",
84
+ Israel = "il",
85
+ Italy = "it",
86
+ Jamaica = "jm",
87
+ Jordan = "jo",
88
+ Japan = "jp",
89
+ Kazakhstan = "kz",
90
+ Kenya = "ke",
91
+ Kyrgyzstan = "kg",
92
+ Cambodia = "kh",
93
+ Kiribati = "ki",
94
+ SaintKittsAndNevis = "kn",
95
+ SouthKorea = "kr",
96
+ Kuwait = "kw",
97
+ LaoPeopleSDemocraticRepublic = "la",
98
+ Lebanon = "lb",
99
+ Liberia = "lr",
100
+ Libya = "ly",
101
+ SaintLucia = "lc",
102
+ Liechtenstein = "li",
103
+ SriLanka = "lk",
104
+ Lesotho = "ls",
105
+ Lithuania = "lt",
106
+ Luxembourg = "lu",
107
+ Latvia = "lv",
108
+ Morocco = "ma",
109
+ Monaco = "mc",
110
+ Moldova = "md",
111
+ Madagascar = "mg",
112
+ Maldives = "mv",
113
+ Mexico = "mx",
114
+ MarshallIslands = "mh",
115
+ NorthMacedonia = "mk",
116
+ Mali = "ml",
117
+ Malta = "mt",
118
+ Myanmar = "mm",
119
+ Montenegro = "me",
120
+ Mongolia = "mn",
121
+ Mozambique = "mz",
122
+ Mauritania = "mr",
123
+ Mauritius = "mu",
124
+ Malawi = "mw",
125
+ Malaysia = "my",
126
+ Namibia = "na",
127
+ Niger = "ne",
128
+ Nigeria = "ng",
129
+ Nicaragua = "ni",
130
+ Netherlands = "nl",
131
+ Norway = "no",
132
+ Nepal = "np",
133
+ Nauru = "nr",
134
+ NewZealand = "nz",
135
+ Oman = "om",
136
+ Pakistan = "pk",
137
+ Panama = "pa",
138
+ Peru = "pe",
139
+ Philippines = "ph",
140
+ Palau = "pw",
141
+ PapuaNewGuinea = "pg",
142
+ Poland = "pl",
143
+ FrenchPolynesia = "pf",
144
+ NorthKorea = "kp",
145
+ Portugal = "pt",
146
+ Paraguay = "py",
147
+ Qatar = "qa",
148
+ Romania = "ro",
149
+ Russia = "ru",
150
+ Rwanda = "rw",
151
+ SaudiArabia = "sa",
152
+ Sudan = "sd",
153
+ Senegal = "sn",
154
+ Singapore = "sg",
155
+ SolomonIslands = "sb",
156
+ SierraLeone = "sl",
157
+ ElSalvador = "sv",
158
+ SanMarino = "sm",
159
+ Somalia = "so",
160
+ Serbia = "rs",
161
+ SouthSudan = "ss",
162
+ SaoTomeAndPrincipe = "st",
163
+ Suriname = "sr",
164
+ Slovakia = "sk",
165
+ Slovenia = "si",
166
+ Sweden = "se",
167
+ Eswatini = "sz",
168
+ Seychelles = "sc",
169
+ Syria = "sy",
170
+ Chad = "td",
171
+ Togo = "tg",
172
+ Thailand = "th",
173
+ Tajikistan = "tj",
174
+ Turkmenistan = "tm",
175
+ TimorLeste = "tl",
176
+ Tonga = "to",
177
+ TrinidadAndTobago = "tt",
178
+ Tunisia = "tn",
179
+ Turkey = "tr",
180
+ Tuvalu = "tv",
181
+ Tanzania = "tz",
182
+ Uganda = "ug",
183
+ Ukraine = "ua",
184
+ Uruguay = "uy",
185
+ UnitedStates = "us",
186
+ Uzbekistan = "uz",
187
+ VaticanCity = "va",
188
+ SaintVincentAndTheGrenadines = "vc",
189
+ Venezuela = "ve",
190
+ Vietnam = "vn",
191
+ Vanuatu = "vu",
192
+ Samoa = "ws",
193
+ Yemen = "ye",
194
+ SouthAfrica = "za",
195
+ Zambia = "zm",
196
+ Zimbabwe = "zw"
197
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum ImageFormat {
2
+ Jpg = "jpg",
3
+ Jpeg = "jpeg",
4
+ Gif = "gif",
5
+ Png = "png",
6
+ Webp = "webp"
7
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum ImageGravity {
2
+ Center = "center",
3
+ TopLeft = "top-left",
4
+ Top = "top",
5
+ TopRight = "top-right",
6
+ Left = "left",
7
+ Right = "right",
8
+ BottomLeft = "bottom-left",
9
+ Bottom = "bottom",
10
+ BottomRight = "bottom-right"
11
+ }
@@ -0,0 +1,41 @@
1
+ export declare enum OAuthProvider {
2
+ Amazon = "amazon",
3
+ Apple = "apple",
4
+ Auth0 = "auth0",
5
+ Authentik = "authentik",
6
+ Autodesk = "autodesk",
7
+ Bitbucket = "bitbucket",
8
+ Bitly = "bitly",
9
+ Box = "box",
10
+ Dailymotion = "dailymotion",
11
+ Discord = "discord",
12
+ Disqus = "disqus",
13
+ Dropbox = "dropbox",
14
+ Etsy = "etsy",
15
+ Facebook = "facebook",
16
+ Github = "github",
17
+ Gitlab = "gitlab",
18
+ Google = "google",
19
+ Linkedin = "linkedin",
20
+ Microsoft = "microsoft",
21
+ Notion = "notion",
22
+ Oidc = "oidc",
23
+ Okta = "okta",
24
+ Paypal = "paypal",
25
+ PaypalSandbox = "paypalSandbox",
26
+ Podio = "podio",
27
+ Salesforce = "salesforce",
28
+ Slack = "slack",
29
+ Spotify = "spotify",
30
+ Stripe = "stripe",
31
+ Tradeshift = "tradeshift",
32
+ TradeshiftBox = "tradeshiftBox",
33
+ Twitch = "twitch",
34
+ Wordpress = "wordpress",
35
+ Yahoo = "yahoo",
36
+ Yammer = "yammer",
37
+ Yandex = "yandex",
38
+ Zoho = "zoho",
39
+ Zoom = "zoom",
40
+ Mock = "mock"
41
+ }
package/types/id.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare class ID {
2
+ #private;
3
+ static custom(id: string): string;
4
+ static unique(padding?: number): string;
5
+ }
@@ -0,0 +1,25 @@
1
+ export { Client, AppwriteException } from './client';
2
+ export { Account } from './services/account';
3
+ export { Avatars } from './services/avatars';
4
+ export { Databases } from './services/databases';
5
+ export { Functions } from './services/functions';
6
+ export { Graphql } from './services/graphql';
7
+ export { Locale } from './services/locale';
8
+ export { Messaging } from './services/messaging';
9
+ export { Storage } from './services/storage';
10
+ export { Teams } from './services/teams';
11
+ export type { Models, Payload, RealtimeResponseEvent, UploadProgress } from './client';
12
+ export type { QueryTypes, QueryTypesList } from './query';
13
+ export { Query } from './query';
14
+ export { Permission } from './permission';
15
+ export { Role } from './role';
16
+ export { ID } from './id';
17
+ export { AuthenticatorType } from './enums/authenticator-type';
18
+ export { AuthenticationFactor } from './enums/authentication-factor';
19
+ export { OAuthProvider } from './enums/o-auth-provider';
20
+ export { Browser } from './enums/browser';
21
+ export { CreditCard } from './enums/credit-card';
22
+ export { Flag } from './enums/flag';
23
+ export { ExecutionMethod } from './enums/execution-method';
24
+ export { ImageGravity } from './enums/image-gravity';
25
+ export { ImageFormat } from './enums/image-format';