@appwrite.io/console 1.8.0 → 1.10.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 +45 -6
- package/README.md +82 -2
- package/dist/cjs/sdk.js +532 -200
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +533 -201
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +532 -200
- package/docs/examples/databases/create-document.md +1 -3
- package/docs/examples/databases/create-documents.md +1 -1
- package/docs/examples/databases/decrement-document-attribute.md +18 -0
- package/docs/examples/databases/increment-document-attribute.md +18 -0
- package/docs/examples/databases/upsert-documents.md +1 -1
- package/docs/examples/domains/create-record-a-a-a-a.md +1 -1
- package/docs/examples/domains/create-record-a.md +1 -1
- package/docs/examples/domains/create-record-alias.md +1 -1
- package/docs/examples/domains/create-record-c-a-a.md +1 -1
- package/docs/examples/domains/create-record-c-n-a-m-e.md +1 -1
- package/docs/examples/domains/create-record-h-t-t-p-s.md +1 -1
- package/docs/examples/domains/create-record-m-x.md +1 -1
- package/docs/examples/domains/create-record-n-s.md +1 -1
- package/docs/examples/domains/create-record-s-r-v.md +1 -1
- package/docs/examples/domains/create-record-t-x-t.md +1 -1
- package/docs/examples/domains/update-record-a-a-a-a.md +1 -1
- package/docs/examples/domains/update-record-a.md +1 -1
- package/docs/examples/domains/update-record-alias.md +1 -1
- package/docs/examples/domains/update-record-c-a-a.md +1 -1
- package/docs/examples/domains/update-record-c-n-a-m-e.md +1 -1
- package/docs/examples/domains/update-record-h-t-t-p-s.md +1 -1
- package/docs/examples/domains/update-record-m-x.md +1 -1
- package/docs/examples/domains/update-record-n-s.md +1 -1
- package/docs/examples/domains/update-record-s-r-v.md +1 -1
- package/docs/examples/domains/update-record-t-x-t.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/health/{get-queue-stats-usage-dump.md → get-queue-billing-project-aggregation.md} +2 -2
- package/docs/examples/health/{get-queue-billing-aggregation.md → get-queue-billing-team-aggregation.md} +1 -1
- package/docs/examples/organizations/cancel-downgrade.md +13 -0
- package/docs/examples/organizations/estimation-create-organization.md +16 -0
- package/docs/examples/organizations/estimation-delete-organization.md +13 -0
- package/docs/examples/organizations/estimation-update-plan.md +16 -0
- package/docs/examples/organizations/get-available-credits.md +13 -0
- package/docs/examples/organizations/get-usage.md +1 -1
- package/docs/examples/organizations/update-projects.md +14 -0
- package/docs/examples/organizations/validate-payment.md +14 -0
- package/docs/examples/proxy/create-redirect-rule.md +4 -2
- package/docs/examples/vcs/get-repository-contents.md +2 -1
- package/package.json +1 -1
- package/src/client.ts +5 -4
- package/src/enums/build-runtime.ts +2 -0
- package/src/enums/image-format.ts +1 -0
- package/src/enums/proxy-resource-type.ts +4 -0
- package/src/enums/runtime.ts +2 -0
- package/src/index.ts +1 -0
- package/src/models.ts +513 -11
- package/src/services/account.ts +97 -36
- package/src/services/avatars.ts +26 -20
- package/src/services/backups.ts +11 -0
- package/src/services/console.ts +8 -1
- package/src/services/databases.ts +190 -31
- package/src/services/domains.ts +111 -69
- package/src/services/functions.ts +37 -8
- package/src/services/graphql.ts +1 -0
- package/src/services/health.ts +54 -4
- package/src/services/locale.ts +9 -2
- package/src/services/messaging.ts +53 -8
- package/src/services/migrations.ts +12 -0
- package/src/services/organizations.ts +301 -14
- package/src/services/project.ts +5 -0
- package/src/services/projects.ts +50 -0
- package/src/services/proxy.ts +23 -1
- package/src/services/sites.ts +32 -4
- package/src/services/storage.ts +23 -9
- package/src/services/teams.ts +30 -17
- package/src/services/tokens.ts +4 -0
- package/src/services/users.ts +69 -27
- package/src/services/vcs.ts +16 -4
- package/types/enums/build-runtime.d.ts +3 -1
- package/types/enums/image-format.d.ts +2 -1
- package/types/enums/proxy-resource-type.d.ts +4 -0
- package/types/enums/runtime.d.ts +3 -1
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +494 -188
- package/types/services/account.d.ts +36 -36
- package/types/services/avatars.d.ts +20 -20
- package/types/services/console.d.ts +1 -1
- package/types/services/databases.d.ts +67 -31
- package/types/services/domains.d.ts +69 -69
- package/types/services/functions.d.ts +8 -8
- package/types/services/health.d.ts +11 -3
- package/types/services/locale.d.ts +2 -2
- package/types/services/messaging.d.ts +8 -8
- package/types/services/organizations.d.ts +88 -14
- package/types/services/proxy.d.ts +4 -1
- package/types/services/sites.d.ts +4 -4
- package/types/services/storage.d.ts +9 -9
- package/types/services/teams.d.ts +17 -17
- package/types/services/users.d.ts +27 -27
- package/types/services/vcs.d.ts +4 -4
- package/docs/examples/functions/create-build.md +0 -15
- package/docs/examples/functions/get-function-usage.md +0 -14
- package/docs/examples/functions/update-deployment-build.md +0 -14
- package/docs/examples/functions/update-deployment.md +0 -14
- package/docs/examples/proxy/create-rule.md +0 -15
- package/src/enums/resource-type.ts +0 -4
- package/types/enums/resource-type.d.ts +0 -4
package/src/services/storage.ts
CHANGED
|
@@ -42,6 +42,7 @@ export class Storage {
|
|
|
42
42
|
payload
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
|
+
|
|
45
46
|
/**
|
|
46
47
|
* Create a new storage bucket.
|
|
47
48
|
*
|
|
@@ -110,6 +111,7 @@ export class Storage {
|
|
|
110
111
|
payload
|
|
111
112
|
);
|
|
112
113
|
}
|
|
114
|
+
|
|
113
115
|
/**
|
|
114
116
|
* Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
|
|
115
117
|
*
|
|
@@ -135,6 +137,7 @@ export class Storage {
|
|
|
135
137
|
payload
|
|
136
138
|
);
|
|
137
139
|
}
|
|
140
|
+
|
|
138
141
|
/**
|
|
139
142
|
* Update a storage bucket by its unique ID.
|
|
140
143
|
*
|
|
@@ -200,6 +203,7 @@ export class Storage {
|
|
|
200
203
|
payload
|
|
201
204
|
);
|
|
202
205
|
}
|
|
206
|
+
|
|
203
207
|
/**
|
|
204
208
|
* Delete a storage bucket by its unique ID.
|
|
205
209
|
*
|
|
@@ -226,6 +230,7 @@ export class Storage {
|
|
|
226
230
|
payload
|
|
227
231
|
);
|
|
228
232
|
}
|
|
233
|
+
|
|
229
234
|
/**
|
|
230
235
|
* Get a list of all the user files. You can use the query params to filter your results.
|
|
231
236
|
*
|
|
@@ -259,15 +264,16 @@ export class Storage {
|
|
|
259
264
|
payload
|
|
260
265
|
);
|
|
261
266
|
}
|
|
267
|
+
|
|
262
268
|
/**
|
|
263
269
|
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
|
|
264
|
-
|
|
265
|
-
Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
266
|
-
|
|
267
|
-
When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
268
|
-
|
|
269
|
-
If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
|
270
|
-
|
|
270
|
+
*
|
|
271
|
+
* Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
|
|
272
|
+
*
|
|
273
|
+
* When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
|
|
274
|
+
*
|
|
275
|
+
* If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
|
|
276
|
+
*
|
|
271
277
|
*
|
|
272
278
|
* @param {string} bucketId
|
|
273
279
|
* @param {string} fileId
|
|
@@ -311,6 +317,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
311
317
|
onProgress
|
|
312
318
|
);
|
|
313
319
|
}
|
|
320
|
+
|
|
314
321
|
/**
|
|
315
322
|
* Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
|
|
316
323
|
*
|
|
@@ -340,6 +347,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
340
347
|
payload
|
|
341
348
|
);
|
|
342
349
|
}
|
|
350
|
+
|
|
343
351
|
/**
|
|
344
352
|
* Update a file by its unique ID. Only users with write permissions have access to update this resource.
|
|
345
353
|
*
|
|
@@ -378,6 +386,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
378
386
|
payload
|
|
379
387
|
);
|
|
380
388
|
}
|
|
389
|
+
|
|
381
390
|
/**
|
|
382
391
|
* Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
|
|
383
392
|
*
|
|
@@ -408,6 +417,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
408
417
|
payload
|
|
409
418
|
);
|
|
410
419
|
}
|
|
420
|
+
|
|
411
421
|
/**
|
|
412
422
|
* Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
413
423
|
*
|
|
@@ -442,6 +452,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
442
452
|
|
|
443
453
|
return uri.toString();
|
|
444
454
|
}
|
|
455
|
+
|
|
445
456
|
/**
|
|
446
457
|
* Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
|
|
447
458
|
*
|
|
@@ -520,6 +531,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
520
531
|
|
|
521
532
|
return uri.toString();
|
|
522
533
|
}
|
|
534
|
+
|
|
523
535
|
/**
|
|
524
536
|
* Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
|
|
525
537
|
*
|
|
@@ -554,9 +566,10 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
554
566
|
|
|
555
567
|
return uri.toString();
|
|
556
568
|
}
|
|
569
|
+
|
|
557
570
|
/**
|
|
558
571
|
* Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
559
|
-
|
|
572
|
+
*
|
|
560
573
|
*
|
|
561
574
|
* @param {StorageUsageRange} range
|
|
562
575
|
* @throws {AppwriteException}
|
|
@@ -580,9 +593,10 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk
|
|
|
580
593
|
payload
|
|
581
594
|
);
|
|
582
595
|
}
|
|
596
|
+
|
|
583
597
|
/**
|
|
584
598
|
* Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
585
|
-
|
|
599
|
+
*
|
|
586
600
|
*
|
|
587
601
|
* @param {string} bucketId
|
|
588
602
|
* @param {StorageUsageRange} range
|
package/src/services/teams.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class Teams {
|
|
|
17
17
|
* @throws {AppwriteException}
|
|
18
18
|
* @returns {Promise<Models.TeamList<Preferences>>}
|
|
19
19
|
*/
|
|
20
|
-
list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
|
|
20
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
|
|
21
21
|
const apiPath = '/teams';
|
|
22
22
|
const payload: Payload = {};
|
|
23
23
|
if (typeof queries !== 'undefined') {
|
|
@@ -38,6 +38,7 @@ export class Teams {
|
|
|
38
38
|
payload
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
+
|
|
41
42
|
/**
|
|
42
43
|
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
|
|
43
44
|
*
|
|
@@ -47,7 +48,7 @@ export class Teams {
|
|
|
47
48
|
* @throws {AppwriteException}
|
|
48
49
|
* @returns {Promise<Models.Team<Preferences>>}
|
|
49
50
|
*/
|
|
50
|
-
create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {
|
|
51
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {
|
|
51
52
|
if (typeof teamId === 'undefined') {
|
|
52
53
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
53
54
|
}
|
|
@@ -78,6 +79,7 @@ export class Teams {
|
|
|
78
79
|
payload
|
|
79
80
|
);
|
|
80
81
|
}
|
|
82
|
+
|
|
81
83
|
/**
|
|
82
84
|
* Get a team by its ID. All team members have read access for this resource.
|
|
83
85
|
*
|
|
@@ -85,7 +87,7 @@ export class Teams {
|
|
|
85
87
|
* @throws {AppwriteException}
|
|
86
88
|
* @returns {Promise<Models.Team<Preferences>>}
|
|
87
89
|
*/
|
|
88
|
-
get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>> {
|
|
90
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Models.Team<Preferences>> {
|
|
89
91
|
if (typeof teamId === 'undefined') {
|
|
90
92
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
91
93
|
}
|
|
@@ -103,6 +105,7 @@ export class Teams {
|
|
|
103
105
|
payload
|
|
104
106
|
);
|
|
105
107
|
}
|
|
108
|
+
|
|
106
109
|
/**
|
|
107
110
|
* Update the team's name by its unique ID.
|
|
108
111
|
*
|
|
@@ -111,7 +114,7 @@ export class Teams {
|
|
|
111
114
|
* @throws {AppwriteException}
|
|
112
115
|
* @returns {Promise<Models.Team<Preferences>>}
|
|
113
116
|
*/
|
|
114
|
-
updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {
|
|
117
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {
|
|
115
118
|
if (typeof teamId === 'undefined') {
|
|
116
119
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
117
120
|
}
|
|
@@ -136,6 +139,7 @@ export class Teams {
|
|
|
136
139
|
payload
|
|
137
140
|
);
|
|
138
141
|
}
|
|
142
|
+
|
|
139
143
|
/**
|
|
140
144
|
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
|
141
145
|
*
|
|
@@ -162,6 +166,7 @@ export class Teams {
|
|
|
162
166
|
payload
|
|
163
167
|
);
|
|
164
168
|
}
|
|
169
|
+
|
|
165
170
|
/**
|
|
166
171
|
* Get the team activity logs list by its unique ID.
|
|
167
172
|
*
|
|
@@ -191,6 +196,7 @@ export class Teams {
|
|
|
191
196
|
payload
|
|
192
197
|
);
|
|
193
198
|
}
|
|
199
|
+
|
|
194
200
|
/**
|
|
195
201
|
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
196
202
|
*
|
|
@@ -224,15 +230,16 @@ export class Teams {
|
|
|
224
230
|
payload
|
|
225
231
|
);
|
|
226
232
|
}
|
|
233
|
+
|
|
227
234
|
/**
|
|
228
235
|
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
|
229
|
-
|
|
230
|
-
You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
231
|
-
|
|
232
|
-
Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
233
|
-
|
|
234
|
-
Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
|
235
|
-
|
|
236
|
+
*
|
|
237
|
+
* You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
238
|
+
*
|
|
239
|
+
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
240
|
+
*
|
|
241
|
+
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
|
242
|
+
*
|
|
236
243
|
*
|
|
237
244
|
* @param {string} teamId
|
|
238
245
|
* @param {string[]} roles
|
|
@@ -284,6 +291,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
|
|
|
284
291
|
payload
|
|
285
292
|
);
|
|
286
293
|
}
|
|
294
|
+
|
|
287
295
|
/**
|
|
288
296
|
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
289
297
|
*
|
|
@@ -313,9 +321,10 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
|
|
|
313
321
|
payload
|
|
314
322
|
);
|
|
315
323
|
}
|
|
324
|
+
|
|
316
325
|
/**
|
|
317
326
|
* Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
|
|
318
|
-
|
|
327
|
+
*
|
|
319
328
|
*
|
|
320
329
|
* @param {string} teamId
|
|
321
330
|
* @param {string} membershipId
|
|
@@ -351,6 +360,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
|
|
|
351
360
|
payload
|
|
352
361
|
);
|
|
353
362
|
}
|
|
363
|
+
|
|
354
364
|
/**
|
|
355
365
|
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
|
356
366
|
*
|
|
@@ -381,11 +391,12 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
|
|
|
381
391
|
payload
|
|
382
392
|
);
|
|
383
393
|
}
|
|
394
|
+
|
|
384
395
|
/**
|
|
385
396
|
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
|
386
|
-
|
|
387
|
-
If the request is successful, a session for the user is automatically created.
|
|
388
|
-
|
|
397
|
+
*
|
|
398
|
+
* If the request is successful, a session for the user is automatically created.
|
|
399
|
+
*
|
|
389
400
|
*
|
|
390
401
|
* @param {string} teamId
|
|
391
402
|
* @param {string} membershipId
|
|
@@ -428,6 +439,7 @@ If the request is successful, a session for the user is automatically created.
|
|
|
428
439
|
payload
|
|
429
440
|
);
|
|
430
441
|
}
|
|
442
|
+
|
|
431
443
|
/**
|
|
432
444
|
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
|
433
445
|
*
|
|
@@ -435,7 +447,7 @@ If the request is successful, a session for the user is automatically created.
|
|
|
435
447
|
* @throws {AppwriteException}
|
|
436
448
|
* @returns {Promise<Preferences>}
|
|
437
449
|
*/
|
|
438
|
-
getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences> {
|
|
450
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Preferences> {
|
|
439
451
|
if (typeof teamId === 'undefined') {
|
|
440
452
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
441
453
|
}
|
|
@@ -453,6 +465,7 @@ If the request is successful, a session for the user is automatically created.
|
|
|
453
465
|
payload
|
|
454
466
|
);
|
|
455
467
|
}
|
|
468
|
+
|
|
456
469
|
/**
|
|
457
470
|
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
|
458
471
|
*
|
|
@@ -461,7 +474,7 @@ If the request is successful, a session for the user is automatically created.
|
|
|
461
474
|
* @throws {AppwriteException}
|
|
462
475
|
* @returns {Promise<Preferences>}
|
|
463
476
|
*/
|
|
464
|
-
updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences> {
|
|
477
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, prefs: object): Promise<Preferences> {
|
|
465
478
|
if (typeof teamId === 'undefined') {
|
|
466
479
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
467
480
|
}
|
package/src/services/tokens.ts
CHANGED
|
@@ -42,6 +42,7 @@ export class Tokens {
|
|
|
42
42
|
payload
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
|
+
|
|
45
46
|
/**
|
|
46
47
|
* Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.
|
|
47
48
|
*
|
|
@@ -76,6 +77,7 @@ export class Tokens {
|
|
|
76
77
|
payload
|
|
77
78
|
);
|
|
78
79
|
}
|
|
80
|
+
|
|
79
81
|
/**
|
|
80
82
|
* Get a token by its unique ID.
|
|
81
83
|
*
|
|
@@ -101,6 +103,7 @@ export class Tokens {
|
|
|
101
103
|
payload
|
|
102
104
|
);
|
|
103
105
|
}
|
|
106
|
+
|
|
104
107
|
/**
|
|
105
108
|
* Update a token by its unique ID. Use this endpoint to update a token's expiry date.
|
|
106
109
|
*
|
|
@@ -131,6 +134,7 @@ export class Tokens {
|
|
|
131
134
|
payload
|
|
132
135
|
);
|
|
133
136
|
}
|
|
137
|
+
|
|
134
138
|
/**
|
|
135
139
|
* Delete a token by its unique ID.
|
|
136
140
|
*
|