react-native-appwrite 0.10.0 → 0.10.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/.github/workflows/publish.yml +1 -1
- package/CHANGELOG.md +5 -0
- package/dist/cjs/sdk.js +161 -1
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +161 -1
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/image-format.ts +1 -0
- package/src/services/avatars.ts +35 -0
- package/src/services/databases.ts +4 -0
- package/src/services/storage.ts +15 -0
- package/types/enums/image-format.d.ts +2 -1
- package/types/services/databases.d.ts +4 -0
package/dist/esm/sdk.js
CHANGED
|
@@ -78,7 +78,7 @@ class Client {
|
|
|
78
78
|
'x-sdk-name': 'React Native',
|
|
79
79
|
'x-sdk-platform': 'client',
|
|
80
80
|
'x-sdk-language': 'reactnative',
|
|
81
|
-
'x-sdk-version': '0.10.
|
|
81
|
+
'x-sdk-version': '0.10.1',
|
|
82
82
|
'X-Appwrite-Response-Format': '1.7.0',
|
|
83
83
|
};
|
|
84
84
|
this.realtime = {
|
|
@@ -1985,7 +1985,21 @@ class Avatars extends Service {
|
|
|
1985
1985
|
*/
|
|
1986
1986
|
getBrowserURL(code, width, height, quality) {
|
|
1987
1987
|
const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);
|
|
1988
|
+
const payload = {};
|
|
1989
|
+
if (typeof width !== 'undefined') {
|
|
1990
|
+
payload['width'] = width;
|
|
1991
|
+
}
|
|
1992
|
+
if (typeof height !== 'undefined') {
|
|
1993
|
+
payload['height'] = height;
|
|
1994
|
+
}
|
|
1995
|
+
if (typeof quality !== 'undefined') {
|
|
1996
|
+
payload['quality'] = quality;
|
|
1997
|
+
}
|
|
1988
1998
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1999
|
+
payload['project'] = this.client.config.project;
|
|
2000
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2001
|
+
uri.searchParams.append(key, value);
|
|
2002
|
+
}
|
|
1989
2003
|
return uri;
|
|
1990
2004
|
}
|
|
1991
2005
|
/**
|
|
@@ -2008,7 +2022,21 @@ class Avatars extends Service {
|
|
|
2008
2022
|
*/
|
|
2009
2023
|
getCreditCardURL(code, width, height, quality) {
|
|
2010
2024
|
const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);
|
|
2025
|
+
const payload = {};
|
|
2026
|
+
if (typeof width !== 'undefined') {
|
|
2027
|
+
payload['width'] = width;
|
|
2028
|
+
}
|
|
2029
|
+
if (typeof height !== 'undefined') {
|
|
2030
|
+
payload['height'] = height;
|
|
2031
|
+
}
|
|
2032
|
+
if (typeof quality !== 'undefined') {
|
|
2033
|
+
payload['quality'] = quality;
|
|
2034
|
+
}
|
|
2011
2035
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2036
|
+
payload['project'] = this.client.config.project;
|
|
2037
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2038
|
+
uri.searchParams.append(key, value);
|
|
2039
|
+
}
|
|
2012
2040
|
return uri;
|
|
2013
2041
|
}
|
|
2014
2042
|
/**
|
|
@@ -2023,7 +2051,15 @@ class Avatars extends Service {
|
|
|
2023
2051
|
*/
|
|
2024
2052
|
getFaviconURL(url) {
|
|
2025
2053
|
const apiPath = '/avatars/favicon';
|
|
2054
|
+
const payload = {};
|
|
2055
|
+
if (typeof url !== 'undefined') {
|
|
2056
|
+
payload['url'] = url;
|
|
2057
|
+
}
|
|
2026
2058
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2059
|
+
payload['project'] = this.client.config.project;
|
|
2060
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2061
|
+
uri.searchParams.append(key, value);
|
|
2062
|
+
}
|
|
2027
2063
|
return uri;
|
|
2028
2064
|
}
|
|
2029
2065
|
/**
|
|
@@ -2047,7 +2083,21 @@ class Avatars extends Service {
|
|
|
2047
2083
|
*/
|
|
2048
2084
|
getFlagURL(code, width, height, quality) {
|
|
2049
2085
|
const apiPath = '/avatars/flags/{code}'.replace('{code}', code);
|
|
2086
|
+
const payload = {};
|
|
2087
|
+
if (typeof width !== 'undefined') {
|
|
2088
|
+
payload['width'] = width;
|
|
2089
|
+
}
|
|
2090
|
+
if (typeof height !== 'undefined') {
|
|
2091
|
+
payload['height'] = height;
|
|
2092
|
+
}
|
|
2093
|
+
if (typeof quality !== 'undefined') {
|
|
2094
|
+
payload['quality'] = quality;
|
|
2095
|
+
}
|
|
2050
2096
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2097
|
+
payload['project'] = this.client.config.project;
|
|
2098
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2099
|
+
uri.searchParams.append(key, value);
|
|
2100
|
+
}
|
|
2051
2101
|
return uri;
|
|
2052
2102
|
}
|
|
2053
2103
|
/**
|
|
@@ -2071,7 +2121,21 @@ class Avatars extends Service {
|
|
|
2071
2121
|
*/
|
|
2072
2122
|
getImageURL(url, width, height) {
|
|
2073
2123
|
const apiPath = '/avatars/image';
|
|
2124
|
+
const payload = {};
|
|
2125
|
+
if (typeof url !== 'undefined') {
|
|
2126
|
+
payload['url'] = url;
|
|
2127
|
+
}
|
|
2128
|
+
if (typeof width !== 'undefined') {
|
|
2129
|
+
payload['width'] = width;
|
|
2130
|
+
}
|
|
2131
|
+
if (typeof height !== 'undefined') {
|
|
2132
|
+
payload['height'] = height;
|
|
2133
|
+
}
|
|
2074
2134
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2135
|
+
payload['project'] = this.client.config.project;
|
|
2136
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2137
|
+
uri.searchParams.append(key, value);
|
|
2138
|
+
}
|
|
2075
2139
|
return uri;
|
|
2076
2140
|
}
|
|
2077
2141
|
/**
|
|
@@ -2101,7 +2165,24 @@ class Avatars extends Service {
|
|
|
2101
2165
|
*/
|
|
2102
2166
|
getInitialsURL(name, width, height, background) {
|
|
2103
2167
|
const apiPath = '/avatars/initials';
|
|
2168
|
+
const payload = {};
|
|
2169
|
+
if (typeof name !== 'undefined') {
|
|
2170
|
+
payload['name'] = name;
|
|
2171
|
+
}
|
|
2172
|
+
if (typeof width !== 'undefined') {
|
|
2173
|
+
payload['width'] = width;
|
|
2174
|
+
}
|
|
2175
|
+
if (typeof height !== 'undefined') {
|
|
2176
|
+
payload['height'] = height;
|
|
2177
|
+
}
|
|
2178
|
+
if (typeof background !== 'undefined') {
|
|
2179
|
+
payload['background'] = background;
|
|
2180
|
+
}
|
|
2104
2181
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2182
|
+
payload['project'] = this.client.config.project;
|
|
2183
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2184
|
+
uri.searchParams.append(key, value);
|
|
2185
|
+
}
|
|
2105
2186
|
return uri;
|
|
2106
2187
|
}
|
|
2107
2188
|
/**
|
|
@@ -2118,7 +2199,24 @@ class Avatars extends Service {
|
|
|
2118
2199
|
*/
|
|
2119
2200
|
getQRURL(text, size, margin, download) {
|
|
2120
2201
|
const apiPath = '/avatars/qr';
|
|
2202
|
+
const payload = {};
|
|
2203
|
+
if (typeof text !== 'undefined') {
|
|
2204
|
+
payload['text'] = text;
|
|
2205
|
+
}
|
|
2206
|
+
if (typeof size !== 'undefined') {
|
|
2207
|
+
payload['size'] = size;
|
|
2208
|
+
}
|
|
2209
|
+
if (typeof margin !== 'undefined') {
|
|
2210
|
+
payload['margin'] = margin;
|
|
2211
|
+
}
|
|
2212
|
+
if (typeof download !== 'undefined') {
|
|
2213
|
+
payload['download'] = download;
|
|
2214
|
+
}
|
|
2121
2215
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2216
|
+
payload['project'] = this.client.config.project;
|
|
2217
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2218
|
+
uri.searchParams.append(key, value);
|
|
2219
|
+
}
|
|
2122
2220
|
return uri;
|
|
2123
2221
|
}
|
|
2124
2222
|
}
|
|
@@ -2225,6 +2323,10 @@ class Databases extends Service {
|
|
|
2225
2323
|
return this.client.call('get', uri, {}, payload);
|
|
2226
2324
|
}
|
|
2227
2325
|
/**
|
|
2326
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not
|
|
2327
|
+
* yet officially supported. It may be subject to breaking changes or removal
|
|
2328
|
+
* in future versions.
|
|
2329
|
+
*
|
|
2228
2330
|
* Create or update a Document. Before using this route, you should create a
|
|
2229
2331
|
* new collection resource using either a [server
|
|
2230
2332
|
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
@@ -2997,7 +3099,15 @@ class Storage extends Service {
|
|
|
2997
3099
|
*/
|
|
2998
3100
|
getFileDownloadURL(bucketId, fileId, token) {
|
|
2999
3101
|
const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
3102
|
+
const payload = {};
|
|
3103
|
+
if (typeof token !== 'undefined') {
|
|
3104
|
+
payload['token'] = token;
|
|
3105
|
+
}
|
|
3000
3106
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3107
|
+
payload['project'] = this.client.config.project;
|
|
3108
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
3109
|
+
uri.searchParams.append(key, value);
|
|
3110
|
+
}
|
|
3001
3111
|
return uri;
|
|
3002
3112
|
}
|
|
3003
3113
|
/**
|
|
@@ -3026,7 +3136,48 @@ class Storage extends Service {
|
|
|
3026
3136
|
*/
|
|
3027
3137
|
getFilePreviewURL(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output, token) {
|
|
3028
3138
|
const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
3139
|
+
const payload = {};
|
|
3140
|
+
if (typeof width !== 'undefined') {
|
|
3141
|
+
payload['width'] = width;
|
|
3142
|
+
}
|
|
3143
|
+
if (typeof height !== 'undefined') {
|
|
3144
|
+
payload['height'] = height;
|
|
3145
|
+
}
|
|
3146
|
+
if (typeof gravity !== 'undefined') {
|
|
3147
|
+
payload['gravity'] = gravity;
|
|
3148
|
+
}
|
|
3149
|
+
if (typeof quality !== 'undefined') {
|
|
3150
|
+
payload['quality'] = quality;
|
|
3151
|
+
}
|
|
3152
|
+
if (typeof borderWidth !== 'undefined') {
|
|
3153
|
+
payload['borderWidth'] = borderWidth;
|
|
3154
|
+
}
|
|
3155
|
+
if (typeof borderColor !== 'undefined') {
|
|
3156
|
+
payload['borderColor'] = borderColor;
|
|
3157
|
+
}
|
|
3158
|
+
if (typeof borderRadius !== 'undefined') {
|
|
3159
|
+
payload['borderRadius'] = borderRadius;
|
|
3160
|
+
}
|
|
3161
|
+
if (typeof opacity !== 'undefined') {
|
|
3162
|
+
payload['opacity'] = opacity;
|
|
3163
|
+
}
|
|
3164
|
+
if (typeof rotation !== 'undefined') {
|
|
3165
|
+
payload['rotation'] = rotation;
|
|
3166
|
+
}
|
|
3167
|
+
if (typeof background !== 'undefined') {
|
|
3168
|
+
payload['background'] = background;
|
|
3169
|
+
}
|
|
3170
|
+
if (typeof output !== 'undefined') {
|
|
3171
|
+
payload['output'] = output;
|
|
3172
|
+
}
|
|
3173
|
+
if (typeof token !== 'undefined') {
|
|
3174
|
+
payload['token'] = token;
|
|
3175
|
+
}
|
|
3029
3176
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3177
|
+
payload['project'] = this.client.config.project;
|
|
3178
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
3179
|
+
uri.searchParams.append(key, value);
|
|
3180
|
+
}
|
|
3030
3181
|
return uri;
|
|
3031
3182
|
}
|
|
3032
3183
|
/**
|
|
@@ -3042,7 +3193,15 @@ class Storage extends Service {
|
|
|
3042
3193
|
*/
|
|
3043
3194
|
getFileViewURL(bucketId, fileId, token) {
|
|
3044
3195
|
const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
3196
|
+
const payload = {};
|
|
3197
|
+
if (typeof token !== 'undefined') {
|
|
3198
|
+
payload['token'] = token;
|
|
3199
|
+
}
|
|
3045
3200
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3201
|
+
payload['project'] = this.client.config.project;
|
|
3202
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
3203
|
+
uri.searchParams.append(key, value);
|
|
3204
|
+
}
|
|
3046
3205
|
return uri;
|
|
3047
3206
|
}
|
|
3048
3207
|
}
|
|
@@ -3931,6 +4090,7 @@ var ImageFormat;
|
|
|
3931
4090
|
ImageFormat["Webp"] = "webp";
|
|
3932
4091
|
ImageFormat["Heic"] = "heic";
|
|
3933
4092
|
ImageFormat["Avif"] = "avif";
|
|
4093
|
+
ImageFormat["Gif"] = "gif";
|
|
3934
4094
|
})(ImageFormat || (ImageFormat = {}));
|
|
3935
4095
|
|
|
3936
4096
|
export { Account, AppwriteException, AuthenticationFactor, AuthenticatorType, Avatars, Browser, Client, CreditCard, Databases, ExecutionMethod, Flag, Functions, Graphql, ID, ImageFormat, ImageGravity, Locale, Messaging, OAuthProvider, Permission, Query, Role, Storage, Teams };
|