react-native-appwrite 0.10.0 → 0.11.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 +1 -1
- package/CHANGELOG.md +12 -1
- package/dist/cjs/sdk.js +333 -97
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +333 -97
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/databases/create-document.md +1 -3
- package/docs/examples/databases/decrement-document-attribute.md +18 -0
- package/docs/examples/databases/increment-document-attribute.md +18 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/image-format.ts +1 -0
- package/src/models.ts +79 -6
- package/src/services/account.ts +58 -58
- package/src/services/avatars.ts +42 -7
- package/src/services/databases.ts +107 -11
- package/src/services/functions.ts +3 -3
- package/src/services/graphql.ts +2 -2
- package/src/services/locale.ts +8 -8
- package/src/services/messaging.ts +2 -2
- package/src/services/storage.ts +23 -8
- package/src/services/teams.ts +19 -19
- package/types/enums/image-format.d.ts +2 -1
- package/types/models.d.ts +68 -47
- package/types/services/account.d.ts +58 -58
- package/types/services/avatars.d.ts +7 -7
- package/types/services/databases.d.ts +41 -11
- package/types/services/functions.d.ts +3 -3
- package/types/services/graphql.d.ts +2 -2
- package/types/services/locale.d.ts +8 -8
- package/types/services/messaging.d.ts +2 -2
- package/types/services/storage.d.ts +8 -8
- package/types/services/teams.d.ts +19 -19
|
@@ -22,8 +22,8 @@ export class Databases extends Service {
|
|
|
22
22
|
* @param {string[]} queries
|
|
23
23
|
* @throws {AppwriteException}
|
|
24
24
|
* @returns {Promise}
|
|
25
|
-
|
|
26
|
-
listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
|
|
25
|
+
*/
|
|
26
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
|
|
27
27
|
if (typeof databaseId === 'undefined') {
|
|
28
28
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
29
29
|
}
|
|
@@ -57,8 +57,8 @@ export class Databases extends Service {
|
|
|
57
57
|
* @param {string[]} permissions
|
|
58
58
|
* @throws {AppwriteException}
|
|
59
59
|
* @returns {Promise}
|
|
60
|
-
|
|
61
|
-
createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
|
|
60
|
+
*/
|
|
61
|
+
createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
|
|
62
62
|
if (typeof databaseId === 'undefined') {
|
|
63
63
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
64
64
|
}
|
|
@@ -106,8 +106,8 @@ export class Databases extends Service {
|
|
|
106
106
|
* @param {string[]} queries
|
|
107
107
|
* @throws {AppwriteException}
|
|
108
108
|
* @returns {Promise}
|
|
109
|
-
|
|
110
|
-
getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
|
|
109
|
+
*/
|
|
110
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
|
|
111
111
|
if (typeof databaseId === 'undefined') {
|
|
112
112
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
113
113
|
}
|
|
@@ -133,6 +133,10 @@ export class Databases extends Service {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not
|
|
137
|
+
* yet officially supported. It may be subject to breaking changes or removal
|
|
138
|
+
* in future versions.
|
|
139
|
+
*
|
|
136
140
|
* Create or update a Document. Before using this route, you should create a
|
|
137
141
|
* new collection resource using either a [server
|
|
138
142
|
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
@@ -145,8 +149,8 @@ export class Databases extends Service {
|
|
|
145
149
|
* @param {string[]} permissions
|
|
146
150
|
* @throws {AppwriteException}
|
|
147
151
|
* @returns {Promise}
|
|
148
|
-
|
|
149
|
-
upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
|
|
152
|
+
*/
|
|
153
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
|
|
150
154
|
if (typeof databaseId === 'undefined') {
|
|
151
155
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
152
156
|
}
|
|
@@ -191,8 +195,8 @@ export class Databases extends Service {
|
|
|
191
195
|
* @param {string[]} permissions
|
|
192
196
|
* @throws {AppwriteException}
|
|
193
197
|
* @returns {Promise}
|
|
194
|
-
|
|
195
|
-
updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document> {
|
|
198
|
+
*/
|
|
199
|
+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document> {
|
|
196
200
|
if (typeof databaseId === 'undefined') {
|
|
197
201
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
198
202
|
}
|
|
@@ -230,7 +234,7 @@ export class Databases extends Service {
|
|
|
230
234
|
* @param {string} documentId
|
|
231
235
|
* @throws {AppwriteException}
|
|
232
236
|
* @returns {Promise}
|
|
233
|
-
|
|
237
|
+
*/
|
|
234
238
|
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> {
|
|
235
239
|
if (typeof databaseId === 'undefined') {
|
|
236
240
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -252,4 +256,96 @@ export class Databases extends Service {
|
|
|
252
256
|
'content-type': 'application/json',
|
|
253
257
|
}, payload);
|
|
254
258
|
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Decrement a specific attribute of a document by a given value.
|
|
262
|
+
*
|
|
263
|
+
* @param {string} databaseId
|
|
264
|
+
* @param {string} collectionId
|
|
265
|
+
* @param {string} documentId
|
|
266
|
+
* @param {string} attribute
|
|
267
|
+
* @param {number} value
|
|
268
|
+
* @param {number} min
|
|
269
|
+
* @throws {AppwriteException}
|
|
270
|
+
* @returns {Promise}
|
|
271
|
+
*/
|
|
272
|
+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document> {
|
|
273
|
+
if (typeof databaseId === 'undefined') {
|
|
274
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (typeof collectionId === 'undefined') {
|
|
278
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (typeof documentId === 'undefined') {
|
|
282
|
+
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (typeof attribute === 'undefined') {
|
|
286
|
+
throw new AppwriteException('Missing required parameter: "attribute"');
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
|
|
290
|
+
const payload: Payload = {};
|
|
291
|
+
|
|
292
|
+
if (typeof value !== 'undefined') {
|
|
293
|
+
payload['value'] = value;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (typeof min !== 'undefined') {
|
|
297
|
+
payload['min'] = min;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
301
|
+
return this.client.call('patch', uri, {
|
|
302
|
+
'content-type': 'application/json',
|
|
303
|
+
}, payload);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Increment a specific attribute of a document by a given value.
|
|
308
|
+
*
|
|
309
|
+
* @param {string} databaseId
|
|
310
|
+
* @param {string} collectionId
|
|
311
|
+
* @param {string} documentId
|
|
312
|
+
* @param {string} attribute
|
|
313
|
+
* @param {number} value
|
|
314
|
+
* @param {number} max
|
|
315
|
+
* @throws {AppwriteException}
|
|
316
|
+
* @returns {Promise}
|
|
317
|
+
*/
|
|
318
|
+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document> {
|
|
319
|
+
if (typeof databaseId === 'undefined') {
|
|
320
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (typeof collectionId === 'undefined') {
|
|
324
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (typeof documentId === 'undefined') {
|
|
328
|
+
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (typeof attribute === 'undefined') {
|
|
332
|
+
throw new AppwriteException('Missing required parameter: "attribute"');
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
|
|
336
|
+
const payload: Payload = {};
|
|
337
|
+
|
|
338
|
+
if (typeof value !== 'undefined') {
|
|
339
|
+
payload['value'] = value;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (typeof max !== 'undefined') {
|
|
343
|
+
payload['max'] = max;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
347
|
+
return this.client.call('patch', uri, {
|
|
348
|
+
'content-type': 'application/json',
|
|
349
|
+
}, payload);
|
|
350
|
+
}
|
|
255
351
|
};
|
|
@@ -22,7 +22,7 @@ export class Functions extends Service {
|
|
|
22
22
|
* @param {string[]} queries
|
|
23
23
|
* @throws {AppwriteException}
|
|
24
24
|
* @returns {Promise}
|
|
25
|
-
|
|
25
|
+
*/
|
|
26
26
|
listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList> {
|
|
27
27
|
if (typeof functionId === 'undefined') {
|
|
28
28
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -55,7 +55,7 @@ export class Functions extends Service {
|
|
|
55
55
|
* @param {string} scheduledAt
|
|
56
56
|
* @throws {AppwriteException}
|
|
57
57
|
* @returns {Promise}
|
|
58
|
-
|
|
58
|
+
*/
|
|
59
59
|
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution> {
|
|
60
60
|
if (typeof functionId === 'undefined') {
|
|
61
61
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -101,7 +101,7 @@ export class Functions extends Service {
|
|
|
101
101
|
* @param {string} executionId
|
|
102
102
|
* @throws {AppwriteException}
|
|
103
103
|
* @returns {Promise}
|
|
104
|
-
|
|
104
|
+
*/
|
|
105
105
|
getExecution(functionId: string, executionId: string): Promise<Models.Execution> {
|
|
106
106
|
if (typeof functionId === 'undefined') {
|
|
107
107
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
package/src/services/graphql.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class Graphql extends Service {
|
|
|
19
19
|
* @param {object} query
|
|
20
20
|
* @throws {AppwriteException}
|
|
21
21
|
* @returns {Promise}
|
|
22
|
-
|
|
22
|
+
*/
|
|
23
23
|
query(query: object): Promise<{}> {
|
|
24
24
|
if (typeof query === 'undefined') {
|
|
25
25
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
@@ -45,7 +45,7 @@ export class Graphql extends Service {
|
|
|
45
45
|
* @param {object} query
|
|
46
46
|
* @throws {AppwriteException}
|
|
47
47
|
* @returns {Promise}
|
|
48
|
-
|
|
48
|
+
*/
|
|
49
49
|
mutation(query: object): Promise<{}> {
|
|
50
50
|
if (typeof query === 'undefined') {
|
|
51
51
|
throw new AppwriteException('Missing required parameter: "query"');
|
package/src/services/locale.ts
CHANGED
|
@@ -23,7 +23,7 @@ export class Locale extends Service {
|
|
|
23
23
|
*
|
|
24
24
|
* @throws {AppwriteException}
|
|
25
25
|
* @returns {Promise}
|
|
26
|
-
|
|
26
|
+
*/
|
|
27
27
|
get(): Promise<Models.Locale> {
|
|
28
28
|
const apiPath = '/locale';
|
|
29
29
|
const payload: Payload = {};
|
|
@@ -39,7 +39,7 @@ export class Locale extends Service {
|
|
|
39
39
|
*
|
|
40
40
|
* @throws {AppwriteException}
|
|
41
41
|
* @returns {Promise}
|
|
42
|
-
|
|
42
|
+
*/
|
|
43
43
|
listCodes(): Promise<Models.LocaleCodeList> {
|
|
44
44
|
const apiPath = '/locale/codes';
|
|
45
45
|
const payload: Payload = {};
|
|
@@ -55,7 +55,7 @@ export class Locale extends Service {
|
|
|
55
55
|
*
|
|
56
56
|
* @throws {AppwriteException}
|
|
57
57
|
* @returns {Promise}
|
|
58
|
-
|
|
58
|
+
*/
|
|
59
59
|
listContinents(): Promise<Models.ContinentList> {
|
|
60
60
|
const apiPath = '/locale/continents';
|
|
61
61
|
const payload: Payload = {};
|
|
@@ -71,7 +71,7 @@ export class Locale extends Service {
|
|
|
71
71
|
*
|
|
72
72
|
* @throws {AppwriteException}
|
|
73
73
|
* @returns {Promise}
|
|
74
|
-
|
|
74
|
+
*/
|
|
75
75
|
listCountries(): Promise<Models.CountryList> {
|
|
76
76
|
const apiPath = '/locale/countries';
|
|
77
77
|
const payload: Payload = {};
|
|
@@ -87,7 +87,7 @@ export class Locale extends Service {
|
|
|
87
87
|
*
|
|
88
88
|
* @throws {AppwriteException}
|
|
89
89
|
* @returns {Promise}
|
|
90
|
-
|
|
90
|
+
*/
|
|
91
91
|
listCountriesEU(): Promise<Models.CountryList> {
|
|
92
92
|
const apiPath = '/locale/countries/eu';
|
|
93
93
|
const payload: Payload = {};
|
|
@@ -103,7 +103,7 @@ export class Locale extends Service {
|
|
|
103
103
|
*
|
|
104
104
|
* @throws {AppwriteException}
|
|
105
105
|
* @returns {Promise}
|
|
106
|
-
|
|
106
|
+
*/
|
|
107
107
|
listCountriesPhones(): Promise<Models.PhoneList> {
|
|
108
108
|
const apiPath = '/locale/countries/phones';
|
|
109
109
|
const payload: Payload = {};
|
|
@@ -120,7 +120,7 @@ export class Locale extends Service {
|
|
|
120
120
|
*
|
|
121
121
|
* @throws {AppwriteException}
|
|
122
122
|
* @returns {Promise}
|
|
123
|
-
|
|
123
|
+
*/
|
|
124
124
|
listCurrencies(): Promise<Models.CurrencyList> {
|
|
125
125
|
const apiPath = '/locale/currencies';
|
|
126
126
|
const payload: Payload = {};
|
|
@@ -136,7 +136,7 @@ export class Locale extends Service {
|
|
|
136
136
|
*
|
|
137
137
|
* @throws {AppwriteException}
|
|
138
138
|
* @returns {Promise}
|
|
139
|
-
|
|
139
|
+
*/
|
|
140
140
|
listLanguages(): Promise<Models.LanguageList> {
|
|
141
141
|
const apiPath = '/locale/languages';
|
|
142
142
|
const payload: Payload = {};
|
|
@@ -21,7 +21,7 @@ export class Messaging extends Service {
|
|
|
21
21
|
* @param {string} targetId
|
|
22
22
|
* @throws {AppwriteException}
|
|
23
23
|
* @returns {Promise}
|
|
24
|
-
|
|
24
|
+
*/
|
|
25
25
|
createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber> {
|
|
26
26
|
if (typeof topicId === 'undefined') {
|
|
27
27
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
@@ -59,7 +59,7 @@ export class Messaging extends Service {
|
|
|
59
59
|
* @param {string} subscriberId
|
|
60
60
|
* @throws {AppwriteException}
|
|
61
61
|
* @returns {Promise}
|
|
62
|
-
|
|
62
|
+
*/
|
|
63
63
|
deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> {
|
|
64
64
|
if (typeof topicId === 'undefined') {
|
|
65
65
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
package/src/services/storage.ts
CHANGED
|
@@ -24,7 +24,7 @@ export class Storage extends Service {
|
|
|
24
24
|
* @param {string} search
|
|
25
25
|
* @throws {AppwriteException}
|
|
26
26
|
* @returns {Promise}
|
|
27
|
-
|
|
27
|
+
*/
|
|
28
28
|
listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {
|
|
29
29
|
if (typeof bucketId === 'undefined') {
|
|
30
30
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -72,7 +72,7 @@ export class Storage extends Service {
|
|
|
72
72
|
* @param {string[]} permissions
|
|
73
73
|
* @throws {AppwriteException}
|
|
74
74
|
* @returns {Promise}
|
|
75
|
-
|
|
75
|
+
*/
|
|
76
76
|
async createFile(bucketId: string, fileId: string, file: {name: string, type: string, size: number, uri: string}, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> {
|
|
77
77
|
if (typeof bucketId === 'undefined') {
|
|
78
78
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -169,7 +169,7 @@ export class Storage extends Service {
|
|
|
169
169
|
* @param {string} fileId
|
|
170
170
|
* @throws {AppwriteException}
|
|
171
171
|
* @returns {Promise}
|
|
172
|
-
|
|
172
|
+
*/
|
|
173
173
|
getFile(bucketId: string, fileId: string): Promise<Models.File> {
|
|
174
174
|
if (typeof bucketId === 'undefined') {
|
|
175
175
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -197,7 +197,7 @@ export class Storage extends Service {
|
|
|
197
197
|
* @param {string[]} permissions
|
|
198
198
|
* @throws {AppwriteException}
|
|
199
199
|
* @returns {Promise}
|
|
200
|
-
|
|
200
|
+
*/
|
|
201
201
|
updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {
|
|
202
202
|
if (typeof bucketId === 'undefined') {
|
|
203
203
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -232,7 +232,7 @@ export class Storage extends Service {
|
|
|
232
232
|
* @param {string} fileId
|
|
233
233
|
* @throws {AppwriteException}
|
|
234
234
|
* @returns {Promise}
|
|
235
|
-
|
|
235
|
+
*/
|
|
236
236
|
deleteFile(bucketId: string, fileId: string): Promise<{}> {
|
|
237
237
|
if (typeof bucketId === 'undefined') {
|
|
238
238
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -261,7 +261,7 @@ export class Storage extends Service {
|
|
|
261
261
|
* @param {string} token
|
|
262
262
|
* @throws {AppwriteException}
|
|
263
263
|
* @returns {ArrayBuffer}
|
|
264
|
-
|
|
264
|
+
*/
|
|
265
265
|
getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer> {
|
|
266
266
|
if (typeof bucketId === 'undefined') {
|
|
267
267
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -312,7 +312,7 @@ export class Storage extends Service {
|
|
|
312
312
|
* @param {string} token
|
|
313
313
|
* @throws {AppwriteException}
|
|
314
314
|
* @returns {ArrayBuffer}
|
|
315
|
-
|
|
315
|
+
*/
|
|
316
316
|
getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise<ArrayBuffer> {
|
|
317
317
|
if (typeof bucketId === 'undefined') {
|
|
318
318
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -394,7 +394,7 @@ export class Storage extends Service {
|
|
|
394
394
|
* @param {string} token
|
|
395
395
|
* @throws {AppwriteException}
|
|
396
396
|
* @returns {ArrayBuffer}
|
|
397
|
-
|
|
397
|
+
*/
|
|
398
398
|
getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer> {
|
|
399
399
|
if (typeof bucketId === 'undefined') {
|
|
400
400
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -442,6 +442,11 @@ export class Storage extends Service {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
445
|
+
payload['project'] = this.client.config.project;
|
|
446
|
+
|
|
447
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
448
|
+
uri.searchParams.append(key, value);
|
|
449
|
+
}
|
|
445
450
|
|
|
446
451
|
return uri;
|
|
447
452
|
}
|
|
@@ -523,6 +528,11 @@ export class Storage extends Service {
|
|
|
523
528
|
}
|
|
524
529
|
|
|
525
530
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
531
|
+
payload['project'] = this.client.config.project;
|
|
532
|
+
|
|
533
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
534
|
+
uri.searchParams.append(key, value);
|
|
535
|
+
}
|
|
526
536
|
|
|
527
537
|
return uri;
|
|
528
538
|
}
|
|
@@ -547,6 +557,11 @@ export class Storage extends Service {
|
|
|
547
557
|
}
|
|
548
558
|
|
|
549
559
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
560
|
+
payload['project'] = this.client.config.project;
|
|
561
|
+
|
|
562
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
563
|
+
uri.searchParams.append(key, value);
|
|
564
|
+
}
|
|
550
565
|
|
|
551
566
|
return uri;
|
|
552
567
|
}
|
package/src/services/teams.ts
CHANGED
|
@@ -21,8 +21,8 @@ export class Teams extends Service {
|
|
|
21
21
|
* @param {string} search
|
|
22
22
|
* @throws {AppwriteException}
|
|
23
23
|
* @returns {Promise}
|
|
24
|
-
|
|
25
|
-
list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
|
|
24
|
+
*/
|
|
25
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
|
|
26
26
|
const apiPath = '/teams';
|
|
27
27
|
const payload: Payload = {};
|
|
28
28
|
|
|
@@ -49,8 +49,8 @@ export class Teams extends Service {
|
|
|
49
49
|
* @param {string[]} roles
|
|
50
50
|
* @throws {AppwriteException}
|
|
51
51
|
* @returns {Promise}
|
|
52
|
-
|
|
53
|
-
create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {
|
|
52
|
+
*/
|
|
53
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {
|
|
54
54
|
if (typeof teamId === 'undefined') {
|
|
55
55
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
56
56
|
}
|
|
@@ -86,8 +86,8 @@ export class Teams extends Service {
|
|
|
86
86
|
* @param {string} teamId
|
|
87
87
|
* @throws {AppwriteException}
|
|
88
88
|
* @returns {Promise}
|
|
89
|
-
|
|
90
|
-
get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>> {
|
|
89
|
+
*/
|
|
90
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Models.Team<Preferences>> {
|
|
91
91
|
if (typeof teamId === 'undefined') {
|
|
92
92
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
93
93
|
}
|
|
@@ -107,8 +107,8 @@ export class Teams extends Service {
|
|
|
107
107
|
* @param {string} name
|
|
108
108
|
* @throws {AppwriteException}
|
|
109
109
|
* @returns {Promise}
|
|
110
|
-
|
|
111
|
-
updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {
|
|
110
|
+
*/
|
|
111
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {
|
|
112
112
|
if (typeof teamId === 'undefined') {
|
|
113
113
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
114
114
|
}
|
|
@@ -137,7 +137,7 @@ export class Teams extends Service {
|
|
|
137
137
|
* @param {string} teamId
|
|
138
138
|
* @throws {AppwriteException}
|
|
139
139
|
* @returns {Promise}
|
|
140
|
-
|
|
140
|
+
*/
|
|
141
141
|
delete(teamId: string): Promise<{}> {
|
|
142
142
|
if (typeof teamId === 'undefined') {
|
|
143
143
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -162,7 +162,7 @@ export class Teams extends Service {
|
|
|
162
162
|
* @param {string} search
|
|
163
163
|
* @throws {AppwriteException}
|
|
164
164
|
* @returns {Promise}
|
|
165
|
-
|
|
165
|
+
*/
|
|
166
166
|
listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList> {
|
|
167
167
|
if (typeof teamId === 'undefined') {
|
|
168
168
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -216,7 +216,7 @@ export class Teams extends Service {
|
|
|
216
216
|
* @param {string} name
|
|
217
217
|
* @throws {AppwriteException}
|
|
218
218
|
* @returns {Promise}
|
|
219
|
-
|
|
219
|
+
*/
|
|
220
220
|
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership> {
|
|
221
221
|
if (typeof teamId === 'undefined') {
|
|
222
222
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -268,7 +268,7 @@ export class Teams extends Service {
|
|
|
268
268
|
* @param {string} membershipId
|
|
269
269
|
* @throws {AppwriteException}
|
|
270
270
|
* @returns {Promise}
|
|
271
|
-
|
|
271
|
+
*/
|
|
272
272
|
getMembership(teamId: string, membershipId: string): Promise<Models.Membership> {
|
|
273
273
|
if (typeof teamId === 'undefined') {
|
|
274
274
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -297,7 +297,7 @@ export class Teams extends Service {
|
|
|
297
297
|
* @param {string[]} roles
|
|
298
298
|
* @throws {AppwriteException}
|
|
299
299
|
* @returns {Promise}
|
|
300
|
-
|
|
300
|
+
*/
|
|
301
301
|
updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership> {
|
|
302
302
|
if (typeof teamId === 'undefined') {
|
|
303
303
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -333,7 +333,7 @@ export class Teams extends Service {
|
|
|
333
333
|
* @param {string} membershipId
|
|
334
334
|
* @throws {AppwriteException}
|
|
335
335
|
* @returns {Promise}
|
|
336
|
-
|
|
336
|
+
*/
|
|
337
337
|
deleteMembership(teamId: string, membershipId: string): Promise<{}> {
|
|
338
338
|
if (typeof teamId === 'undefined') {
|
|
339
339
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -367,7 +367,7 @@ export class Teams extends Service {
|
|
|
367
367
|
* @param {string} secret
|
|
368
368
|
* @throws {AppwriteException}
|
|
369
369
|
* @returns {Promise}
|
|
370
|
-
|
|
370
|
+
*/
|
|
371
371
|
updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership> {
|
|
372
372
|
if (typeof teamId === 'undefined') {
|
|
373
373
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -410,8 +410,8 @@ export class Teams extends Service {
|
|
|
410
410
|
* @param {string} teamId
|
|
411
411
|
* @throws {AppwriteException}
|
|
412
412
|
* @returns {Promise}
|
|
413
|
-
|
|
414
|
-
getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences> {
|
|
413
|
+
*/
|
|
414
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Preferences> {
|
|
415
415
|
if (typeof teamId === 'undefined') {
|
|
416
416
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
417
417
|
}
|
|
@@ -433,8 +433,8 @@ export class Teams extends Service {
|
|
|
433
433
|
* @param {object} prefs
|
|
434
434
|
* @throws {AppwriteException}
|
|
435
435
|
* @returns {Promise}
|
|
436
|
-
|
|
437
|
-
updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences> {
|
|
436
|
+
*/
|
|
437
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, prefs: object): Promise<Preferences> {
|
|
438
438
|
if (typeof teamId === 'undefined') {
|
|
439
439
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
440
440
|
}
|