react-native-appwrite 0.4.0 → 0.6.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/README.md +2 -2
- package/dist/cjs/sdk.js +47 -28
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +47 -28
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-anonymous-session.md +2 -2
- package/docs/examples/account/create-email-password-session.md +2 -2
- package/docs/examples/account/create-email-token.md +2 -2
- package/docs/examples/account/create-j-w-t.md +2 -2
- package/docs/examples/account/create-magic-u-r-l-token.md +2 -2
- package/docs/examples/account/create-mfa-authenticator.md +2 -2
- package/docs/examples/account/create-mfa-challenge.md +2 -2
- package/docs/examples/account/create-mfa-recovery-codes.md +2 -2
- package/docs/examples/account/create-o-auth2session.md +1 -1
- package/docs/examples/account/create-o-auth2token.md +1 -1
- package/docs/examples/account/create-phone-token.md +2 -2
- package/docs/examples/account/create-phone-verification.md +2 -2
- package/docs/examples/account/create-push-target.md +2 -2
- package/docs/examples/account/create-recovery.md +2 -2
- package/docs/examples/account/create-session.md +2 -2
- package/docs/examples/account/create-verification.md +2 -2
- package/docs/examples/account/create.md +2 -2
- package/docs/examples/account/delete-identity.md +2 -2
- package/docs/examples/account/delete-mfa-authenticator.md +3 -4
- package/docs/examples/account/delete-push-target.md +2 -2
- package/docs/examples/account/delete-session.md +2 -2
- package/docs/examples/account/delete-sessions.md +2 -2
- package/docs/examples/account/get-mfa-recovery-codes.md +2 -2
- package/docs/examples/account/get-prefs.md +2 -2
- package/docs/examples/account/get-session.md +2 -2
- package/docs/examples/account/get.md +2 -2
- package/docs/examples/account/list-identities.md +2 -2
- package/docs/examples/account/list-logs.md +2 -2
- package/docs/examples/account/list-mfa-factors.md +2 -2
- package/docs/examples/account/list-sessions.md +2 -2
- package/docs/examples/account/update-email.md +2 -2
- package/docs/examples/account/update-m-f-a.md +2 -2
- package/docs/examples/account/update-magic-u-r-l-session.md +2 -2
- package/docs/examples/account/update-mfa-authenticator.md +2 -2
- package/docs/examples/account/update-mfa-challenge.md +2 -2
- package/docs/examples/account/update-mfa-recovery-codes.md +2 -2
- package/docs/examples/account/update-name.md +2 -2
- package/docs/examples/account/update-password.md +2 -2
- package/docs/examples/account/update-phone-session.md +2 -2
- package/docs/examples/account/update-phone-verification.md +2 -2
- package/docs/examples/account/update-phone.md +2 -2
- package/docs/examples/account/update-prefs.md +2 -2
- package/docs/examples/account/update-push-target.md +2 -2
- package/docs/examples/account/update-recovery.md +2 -2
- package/docs/examples/account/update-session.md +2 -2
- package/docs/examples/account/update-status.md +2 -2
- package/docs/examples/account/update-verification.md +2 -2
- package/docs/examples/avatars/get-browser.md +1 -1
- package/docs/examples/avatars/get-credit-card.md +1 -1
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +1 -1
- package/docs/examples/avatars/get-image.md +1 -1
- package/docs/examples/avatars/get-initials.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/databases/create-document.md +2 -2
- package/docs/examples/databases/delete-document.md +2 -2
- package/docs/examples/databases/get-document.md +2 -2
- package/docs/examples/databases/list-documents.md +2 -2
- package/docs/examples/databases/update-document.md +2 -2
- package/docs/examples/functions/create-execution.md +4 -3
- package/docs/examples/functions/get-execution.md +2 -2
- package/docs/examples/functions/list-executions.md +2 -2
- package/docs/examples/graphql/mutation.md +2 -2
- package/docs/examples/graphql/query.md +2 -2
- package/docs/examples/locale/get.md +2 -2
- package/docs/examples/locale/list-codes.md +2 -2
- package/docs/examples/locale/list-continents.md +2 -2
- package/docs/examples/locale/list-countries-e-u.md +2 -2
- package/docs/examples/locale/list-countries-phones.md +2 -2
- package/docs/examples/locale/list-countries.md +2 -2
- package/docs/examples/locale/list-currencies.md +2 -2
- package/docs/examples/locale/list-languages.md +2 -2
- package/docs/examples/messaging/create-subscriber.md +2 -2
- package/docs/examples/messaging/delete-subscriber.md +2 -2
- package/docs/examples/storage/create-file.md +2 -2
- package/docs/examples/storage/delete-file.md +2 -2
- package/docs/examples/storage/get-file-download.md +1 -1
- package/docs/examples/storage/get-file-preview.md +1 -1
- package/docs/examples/storage/get-file-view.md +1 -1
- package/docs/examples/storage/get-file.md +2 -2
- package/docs/examples/storage/list-files.md +2 -2
- package/docs/examples/storage/update-file.md +2 -2
- package/docs/examples/teams/create-membership.md +2 -2
- package/docs/examples/teams/create.md +2 -2
- package/docs/examples/teams/delete-membership.md +2 -2
- package/docs/examples/teams/delete.md +2 -2
- package/docs/examples/teams/get-membership.md +2 -2
- package/docs/examples/teams/get-prefs.md +2 -2
- package/docs/examples/teams/get.md +2 -2
- package/docs/examples/teams/list-memberships.md +2 -2
- package/docs/examples/teams/list.md +2 -2
- package/docs/examples/teams/update-membership-status.md +2 -2
- package/docs/examples/teams/update-membership.md +2 -2
- package/docs/examples/teams/update-name.md +2 -2
- package/docs/examples/teams/update-prefs.md +2 -2
- package/package.json +1 -1
- package/src/client.ts +31 -2
- package/src/enums/image-format.ts +1 -0
- package/src/models.ts +11 -3
- package/src/services/account.ts +14 -23
- package/src/services/avatars.ts +2 -0
- package/src/services/functions.ts +6 -1
- package/src/services/locale.ts +1 -1
- package/src/services/storage.ts +1 -1
- package/src/services/teams.ts +4 -2
- package/types/enums/image-format.d.ts +2 -1
- package/types/models.d.ts +11 -3
- package/types/services/account.d.ts +13 -14
- package/types/services/avatars.d.ts +2 -0
- package/types/services/functions.d.ts +2 -1
- package/types/services/locale.d.ts +1 -1
- package/types/services/storage.d.ts +1 -1
- package/types/services/teams.d.ts +4 -2
|
@@ -2,7 +2,7 @@ import { Client, Teams } from "react-native-appwrite";
|
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
6
|
|
|
7
7
|
const teams = new Teams(client);
|
|
8
8
|
|
|
@@ -10,4 +10,4 @@ const result = await teams.getPrefs(
|
|
|
10
10
|
'<TEAM_ID>' // teamId
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
-
console.log(
|
|
13
|
+
console.log(result);
|
|
@@ -2,7 +2,7 @@ import { Client, Teams } from "react-native-appwrite";
|
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
6
|
|
|
7
7
|
const teams = new Teams(client);
|
|
8
8
|
|
|
@@ -10,4 +10,4 @@ const result = await teams.get(
|
|
|
10
10
|
'<TEAM_ID>' // teamId
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
-
console.log(
|
|
13
|
+
console.log(result);
|
|
@@ -2,7 +2,7 @@ import { Client, Teams } from "react-native-appwrite";
|
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
6
|
|
|
7
7
|
const teams = new Teams(client);
|
|
8
8
|
|
|
@@ -12,4 +12,4 @@ const result = await teams.listMemberships(
|
|
|
12
12
|
'<SEARCH>' // search (optional)
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
console.log(
|
|
15
|
+
console.log(result);
|
|
@@ -2,7 +2,7 @@ import { Client, Teams } from "react-native-appwrite";
|
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
6
|
|
|
7
7
|
const teams = new Teams(client);
|
|
8
8
|
|
|
@@ -11,4 +11,4 @@ const result = await teams.list(
|
|
|
11
11
|
'<SEARCH>' // search (optional)
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
console.log(
|
|
14
|
+
console.log(result);
|
|
@@ -2,7 +2,7 @@ import { Client, Teams } from "react-native-appwrite";
|
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
6
|
|
|
7
7
|
const teams = new Teams(client);
|
|
8
8
|
|
|
@@ -13,4 +13,4 @@ const result = await teams.updateMembershipStatus(
|
|
|
13
13
|
'<SECRET>' // secret
|
|
14
14
|
);
|
|
15
15
|
|
|
16
|
-
console.log(
|
|
16
|
+
console.log(result);
|
|
@@ -2,7 +2,7 @@ import { Client, Teams } from "react-native-appwrite";
|
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
6
|
|
|
7
7
|
const teams = new Teams(client);
|
|
8
8
|
|
|
@@ -12,4 +12,4 @@ const result = await teams.updateMembership(
|
|
|
12
12
|
[] // roles
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
console.log(
|
|
15
|
+
console.log(result);
|
|
@@ -2,7 +2,7 @@ import { Client, Teams } from "react-native-appwrite";
|
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
6
|
|
|
7
7
|
const teams = new Teams(client);
|
|
8
8
|
|
|
@@ -11,4 +11,4 @@ const result = await teams.updateName(
|
|
|
11
11
|
'<NAME>' // name
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
console.log(
|
|
14
|
+
console.log(result);
|
|
@@ -2,7 +2,7 @@ import { Client, Teams } from "react-native-appwrite";
|
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
-
.setProject('
|
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
6
6
|
|
|
7
7
|
const teams = new Teams(client);
|
|
8
8
|
|
|
@@ -11,4 +11,4 @@ const result = await teams.updatePrefs(
|
|
|
11
11
|
{} // prefs
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
console.log(
|
|
14
|
+
console.log(result);
|
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.
|
|
5
|
+
"version": "0.6.0",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
package/src/client.ts
CHANGED
|
@@ -49,7 +49,17 @@ type RealtimeRequestAuthenticate = {
|
|
|
49
49
|
|
|
50
50
|
type Realtime = {
|
|
51
51
|
socket?: WebSocket;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Timeout for reconnect operations.
|
|
55
|
+
*/
|
|
52
56
|
timeout?: number;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Heartbeat interval for the realtime connection.
|
|
60
|
+
*/
|
|
61
|
+
heartbeat?: number;
|
|
62
|
+
|
|
53
63
|
url?: string;
|
|
54
64
|
lastMessage?: RealtimeResponse;
|
|
55
65
|
channels: Set<string>;
|
|
@@ -63,6 +73,7 @@ type Realtime = {
|
|
|
63
73
|
getTimeout: () => number;
|
|
64
74
|
connect: () => void;
|
|
65
75
|
createSocket: () => void;
|
|
76
|
+
createHeartbeat: () => void;
|
|
66
77
|
cleanUp: (channels: string[]) => void;
|
|
67
78
|
onMessage: (event: MessageEvent) => void;
|
|
68
79
|
}
|
|
@@ -103,8 +114,8 @@ class Client {
|
|
|
103
114
|
'x-sdk-name': 'React Native',
|
|
104
115
|
'x-sdk-platform': 'client',
|
|
105
116
|
'x-sdk-language': 'reactnative',
|
|
106
|
-
'x-sdk-version': '0.
|
|
107
|
-
'X-Appwrite-Response-Format': '1.
|
|
117
|
+
'x-sdk-version': '0.6.0',
|
|
118
|
+
'X-Appwrite-Response-Format': '1.6.0',
|
|
108
119
|
};
|
|
109
120
|
|
|
110
121
|
/**
|
|
@@ -212,6 +223,7 @@ class Client {
|
|
|
212
223
|
private realtime: Realtime = {
|
|
213
224
|
socket: undefined,
|
|
214
225
|
timeout: undefined,
|
|
226
|
+
heartbeat: undefined,
|
|
215
227
|
url: '',
|
|
216
228
|
channels: new Set(),
|
|
217
229
|
subscriptions: new Map(),
|
|
@@ -237,6 +249,17 @@ class Client {
|
|
|
237
249
|
return 60_000;
|
|
238
250
|
}
|
|
239
251
|
},
|
|
252
|
+
createHeartbeat: () => {
|
|
253
|
+
if (this.realtime.heartbeat) {
|
|
254
|
+
clearTimeout(this.realtime.heartbeat);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
this.realtime.heartbeat = window?.setInterval(() => {
|
|
258
|
+
this.realtime.socket?.send(JSON.stringify({
|
|
259
|
+
type: 'ping'
|
|
260
|
+
}));
|
|
261
|
+
}, 20_000);
|
|
262
|
+
},
|
|
240
263
|
createSocket: () => {
|
|
241
264
|
if (this.realtime.channels.size < 1) {
|
|
242
265
|
this.realtime.reconnect = false;
|
|
@@ -275,6 +298,7 @@ class Client {
|
|
|
275
298
|
this.realtime.socket.addEventListener('message', this.realtime.onMessage);
|
|
276
299
|
this.realtime.socket.addEventListener('open', _event => {
|
|
277
300
|
this.realtime.reconnectAttempts = 0;
|
|
301
|
+
this.realtime.createHeartbeat();
|
|
278
302
|
});
|
|
279
303
|
this.realtime.socket.addEventListener('close', event => {
|
|
280
304
|
if (
|
|
@@ -428,6 +452,11 @@ class Client {
|
|
|
428
452
|
let data = null;
|
|
429
453
|
const response = await fetch(url.toString(), options);
|
|
430
454
|
|
|
455
|
+
const warnings = response.headers.get('x-appwrite-warning');
|
|
456
|
+
if (warnings) {
|
|
457
|
+
warnings.split(';').forEach((warning: string) => console.warn('Warning: ' + warning));
|
|
458
|
+
}
|
|
459
|
+
|
|
431
460
|
if (response.headers.get('content-type')?.includes('application/json')) {
|
|
432
461
|
data = await response.json();
|
|
433
462
|
} else {
|
package/src/models.ts
CHANGED
|
@@ -839,11 +839,11 @@ export namespace Models {
|
|
|
839
839
|
*/
|
|
840
840
|
userId: string;
|
|
841
841
|
/**
|
|
842
|
-
* User name.
|
|
842
|
+
* User name. Hide this attribute by toggling membership privacy in the Console.
|
|
843
843
|
*/
|
|
844
844
|
userName: string;
|
|
845
845
|
/**
|
|
846
|
-
* User email address.
|
|
846
|
+
* User email address. Hide this attribute by toggling membership privacy in the Console.
|
|
847
847
|
*/
|
|
848
848
|
userEmail: string;
|
|
849
849
|
/**
|
|
@@ -867,7 +867,7 @@ export namespace Models {
|
|
|
867
867
|
*/
|
|
868
868
|
confirm: boolean;
|
|
869
869
|
/**
|
|
870
|
-
* Multi factor authentication status, true if the user has MFA enabled or false otherwise.
|
|
870
|
+
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
|
|
871
871
|
*/
|
|
872
872
|
mfa: boolean;
|
|
873
873
|
/**
|
|
@@ -943,6 +943,10 @@ export namespace Models {
|
|
|
943
943
|
* Function execution duration in seconds.
|
|
944
944
|
*/
|
|
945
945
|
duration: number;
|
|
946
|
+
/**
|
|
947
|
+
* The scheduled time for execution. If left empty, execution will be queued immediately.
|
|
948
|
+
*/
|
|
949
|
+
scheduledAt?: string;
|
|
946
950
|
}
|
|
947
951
|
/**
|
|
948
952
|
* Country
|
|
@@ -1191,5 +1195,9 @@ export namespace Models {
|
|
|
1191
1195
|
* The target identifier.
|
|
1192
1196
|
*/
|
|
1193
1197
|
identifier: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* Is the target expired.
|
|
1200
|
+
*/
|
|
1201
|
+
expired: boolean;
|
|
1194
1202
|
}
|
|
1195
1203
|
}
|
package/src/services/account.ts
CHANGED
|
@@ -134,7 +134,7 @@ export class Account extends Service {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* List
|
|
137
|
+
* List identities
|
|
138
138
|
*
|
|
139
139
|
* Get the list of identities for the currently logged in user.
|
|
140
140
|
*
|
|
@@ -192,7 +192,7 @@ export class Account extends Service {
|
|
|
192
192
|
* @returns {Promise}
|
|
193
193
|
*/
|
|
194
194
|
async createJWT(): Promise<Models.Jwt> {
|
|
195
|
-
const apiPath = '/account/
|
|
195
|
+
const apiPath = '/account/jwts';
|
|
196
196
|
const payload: Payload = {};
|
|
197
197
|
|
|
198
198
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -253,7 +253,7 @@ export class Account extends Service {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
*
|
|
256
|
+
* Create authenticator
|
|
257
257
|
*
|
|
258
258
|
* Add an authenticator app to be used as an MFA factor. Verify the
|
|
259
259
|
* authenticator using the [verify
|
|
@@ -279,11 +279,11 @@ export class Account extends Service {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
/**
|
|
282
|
-
* Verify
|
|
282
|
+
* Verify authenticator
|
|
283
283
|
*
|
|
284
284
|
* Verify an authenticator app after adding it using the [add
|
|
285
285
|
* authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
|
|
286
|
-
* method.
|
|
286
|
+
* method.
|
|
287
287
|
*
|
|
288
288
|
* @param {AuthenticatorType} type
|
|
289
289
|
* @param {string} otp
|
|
@@ -313,31 +313,22 @@ export class Account extends Service {
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
/**
|
|
316
|
-
* Delete
|
|
316
|
+
* Delete authenticator
|
|
317
317
|
*
|
|
318
318
|
* Delete an authenticator for a user by ID.
|
|
319
319
|
*
|
|
320
320
|
* @param {AuthenticatorType} type
|
|
321
|
-
* @param {string} otp
|
|
322
321
|
* @throws {AppwriteException}
|
|
323
322
|
* @returns {Promise}
|
|
324
323
|
*/
|
|
325
|
-
async deleteMfaAuthenticator(type: AuthenticatorType
|
|
324
|
+
async deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> {
|
|
326
325
|
if (typeof type === 'undefined') {
|
|
327
326
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
328
327
|
}
|
|
329
328
|
|
|
330
|
-
if (typeof otp === 'undefined') {
|
|
331
|
-
throw new AppwriteException('Missing required parameter: "otp"');
|
|
332
|
-
}
|
|
333
|
-
|
|
334
329
|
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
335
330
|
const payload: Payload = {};
|
|
336
331
|
|
|
337
|
-
if (typeof otp !== 'undefined') {
|
|
338
|
-
payload['otp'] = otp;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
332
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
342
333
|
return await this.client.call('delete', uri, {
|
|
343
334
|
'content-type': 'application/json',
|
|
@@ -345,7 +336,7 @@ export class Account extends Service {
|
|
|
345
336
|
}
|
|
346
337
|
|
|
347
338
|
/**
|
|
348
|
-
* Create
|
|
339
|
+
* Create MFA challenge
|
|
349
340
|
*
|
|
350
341
|
* Begin the process of MFA verification after sign-in. Finish the flow with
|
|
351
342
|
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
@@ -374,7 +365,7 @@ export class Account extends Service {
|
|
|
374
365
|
}
|
|
375
366
|
|
|
376
367
|
/**
|
|
377
|
-
* Create MFA
|
|
368
|
+
* Create MFA challenge (confirmation)
|
|
378
369
|
*
|
|
379
370
|
* Complete the MFA challenge by providing the one-time password. Finish the
|
|
380
371
|
* process of MFA verification by providing the one-time password. To begin
|
|
@@ -414,7 +405,7 @@ export class Account extends Service {
|
|
|
414
405
|
}
|
|
415
406
|
|
|
416
407
|
/**
|
|
417
|
-
* List
|
|
408
|
+
* List factors
|
|
418
409
|
*
|
|
419
410
|
* List the factors available on the account to be used as a MFA challange.
|
|
420
411
|
*
|
|
@@ -432,7 +423,7 @@ export class Account extends Service {
|
|
|
432
423
|
}
|
|
433
424
|
|
|
434
425
|
/**
|
|
435
|
-
* Get MFA
|
|
426
|
+
* Get MFA recovery codes
|
|
436
427
|
*
|
|
437
428
|
* Get recovery codes that can be used as backup for MFA flow. Before getting
|
|
438
429
|
* codes, they must be generated using
|
|
@@ -453,7 +444,7 @@ export class Account extends Service {
|
|
|
453
444
|
}
|
|
454
445
|
|
|
455
446
|
/**
|
|
456
|
-
* Create MFA
|
|
447
|
+
* Create MFA recovery codes
|
|
457
448
|
*
|
|
458
449
|
* Generate recovery codes as backup for MFA flow. It's recommended to
|
|
459
450
|
* generate and show then immediately after user successfully adds their
|
|
@@ -475,7 +466,7 @@ export class Account extends Service {
|
|
|
475
466
|
}
|
|
476
467
|
|
|
477
468
|
/**
|
|
478
|
-
* Regenerate MFA
|
|
469
|
+
* Regenerate MFA recovery codes
|
|
479
470
|
*
|
|
480
471
|
* Regenerate recovery codes that can be used as backup for MFA flow. Before
|
|
481
472
|
* regenerating codes, they must be first generated using
|
|
@@ -1520,7 +1511,7 @@ export class Account extends Service {
|
|
|
1520
1511
|
}
|
|
1521
1512
|
|
|
1522
1513
|
/**
|
|
1523
|
-
*
|
|
1514
|
+
* Update phone verification (confirmation)
|
|
1524
1515
|
*
|
|
1525
1516
|
* Use this endpoint to complete the user phone verification process. Use the
|
|
1526
1517
|
* **userId** and **secret** that were sent to your user's phone number to
|
package/src/services/avatars.ts
CHANGED
|
@@ -123,6 +123,7 @@ export class Avatars extends Service {
|
|
|
123
123
|
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
124
124
|
* website URL.
|
|
125
125
|
*
|
|
126
|
+
* This endpoint does not follow HTTP redirects.
|
|
126
127
|
*
|
|
127
128
|
* @param {string} url
|
|
128
129
|
* @throws {AppwriteException}
|
|
@@ -214,6 +215,7 @@ export class Avatars extends Service {
|
|
|
214
215
|
* image at source quality. If dimensions are not specified, the default size
|
|
215
216
|
* of image returned is 400x400px.
|
|
216
217
|
*
|
|
218
|
+
* This endpoint does not follow HTTP redirects.
|
|
217
219
|
*
|
|
218
220
|
* @param {string} url
|
|
219
221
|
* @param {number} width
|
|
@@ -62,10 +62,11 @@ export class Functions extends Service {
|
|
|
62
62
|
* @param {string} xpath
|
|
63
63
|
* @param {ExecutionMethod} method
|
|
64
64
|
* @param {object} headers
|
|
65
|
+
* @param {string} scheduledAt
|
|
65
66
|
* @throws {AppwriteException}
|
|
66
67
|
* @returns {Promise}
|
|
67
68
|
*/
|
|
68
|
-
async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object): Promise<Models.Execution> {
|
|
69
|
+
async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution> {
|
|
69
70
|
if (typeof functionId === 'undefined') {
|
|
70
71
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
71
72
|
}
|
|
@@ -93,6 +94,10 @@ export class Functions extends Service {
|
|
|
93
94
|
payload['headers'] = headers;
|
|
94
95
|
}
|
|
95
96
|
|
|
97
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
98
|
+
payload['scheduledAt'] = scheduledAt;
|
|
99
|
+
}
|
|
100
|
+
|
|
96
101
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
97
102
|
return await this.client.call('post', uri, {
|
|
98
103
|
'content-type': 'application/json',
|
package/src/services/locale.ts
CHANGED
package/src/services/storage.ts
CHANGED
package/src/services/teams.ts
CHANGED
|
@@ -168,7 +168,8 @@ export class Teams extends Service {
|
|
|
168
168
|
* List team memberships
|
|
169
169
|
*
|
|
170
170
|
* Use this endpoint to list a team's members using the team's ID. All team
|
|
171
|
-
* members have read access to this endpoint.
|
|
171
|
+
* members have read access to this endpoint. Hide sensitive attributes from
|
|
172
|
+
* the response by toggling membership privacy in the Console.
|
|
172
173
|
*
|
|
173
174
|
* @param {string} teamId
|
|
174
175
|
* @param {string[]} queries
|
|
@@ -279,7 +280,8 @@ export class Teams extends Service {
|
|
|
279
280
|
* Get team membership
|
|
280
281
|
*
|
|
281
282
|
* Get a team member by the membership unique id. All team members have read
|
|
282
|
-
* access for this resource.
|
|
283
|
+
* access for this resource. Hide sensitive attributes from the response by
|
|
284
|
+
* toggling membership privacy in the Console.
|
|
283
285
|
*
|
|
284
286
|
* @param {string} teamId
|
|
285
287
|
* @param {string} membershipId
|
package/types/models.d.ts
CHANGED
|
@@ -839,11 +839,11 @@ export declare namespace Models {
|
|
|
839
839
|
*/
|
|
840
840
|
userId: string;
|
|
841
841
|
/**
|
|
842
|
-
* User name.
|
|
842
|
+
* User name. Hide this attribute by toggling membership privacy in the Console.
|
|
843
843
|
*/
|
|
844
844
|
userName: string;
|
|
845
845
|
/**
|
|
846
|
-
* User email address.
|
|
846
|
+
* User email address. Hide this attribute by toggling membership privacy in the Console.
|
|
847
847
|
*/
|
|
848
848
|
userEmail: string;
|
|
849
849
|
/**
|
|
@@ -867,7 +867,7 @@ export declare namespace Models {
|
|
|
867
867
|
*/
|
|
868
868
|
confirm: boolean;
|
|
869
869
|
/**
|
|
870
|
-
* Multi factor authentication status, true if the user has MFA enabled or false otherwise.
|
|
870
|
+
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
|
|
871
871
|
*/
|
|
872
872
|
mfa: boolean;
|
|
873
873
|
/**
|
|
@@ -943,6 +943,10 @@ export declare namespace Models {
|
|
|
943
943
|
* Function execution duration in seconds.
|
|
944
944
|
*/
|
|
945
945
|
duration: number;
|
|
946
|
+
/**
|
|
947
|
+
* The scheduled time for execution. If left empty, execution will be queued immediately.
|
|
948
|
+
*/
|
|
949
|
+
scheduledAt?: string;
|
|
946
950
|
};
|
|
947
951
|
/**
|
|
948
952
|
* Country
|
|
@@ -1191,5 +1195,9 @@ export declare namespace Models {
|
|
|
1191
1195
|
* The target identifier.
|
|
1192
1196
|
*/
|
|
1193
1197
|
identifier: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* Is the target expired.
|
|
1200
|
+
*/
|
|
1201
|
+
expired: boolean;
|
|
1194
1202
|
};
|
|
1195
1203
|
}
|
|
@@ -53,7 +53,7 @@ export declare class Account extends Service {
|
|
|
53
53
|
*/
|
|
54
54
|
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
|
|
55
55
|
/**
|
|
56
|
-
* List
|
|
56
|
+
* List identities
|
|
57
57
|
*
|
|
58
58
|
* Get the list of identities for the currently logged in user.
|
|
59
59
|
*
|
|
@@ -107,7 +107,7 @@ export declare class Account extends Service {
|
|
|
107
107
|
*/
|
|
108
108
|
updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>>;
|
|
109
109
|
/**
|
|
110
|
-
*
|
|
110
|
+
* Create authenticator
|
|
111
111
|
*
|
|
112
112
|
* Add an authenticator app to be used as an MFA factor. Verify the
|
|
113
113
|
* authenticator using the [verify
|
|
@@ -120,11 +120,11 @@ export declare class Account extends Service {
|
|
|
120
120
|
*/
|
|
121
121
|
createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType>;
|
|
122
122
|
/**
|
|
123
|
-
* Verify
|
|
123
|
+
* Verify authenticator
|
|
124
124
|
*
|
|
125
125
|
* Verify an authenticator app after adding it using the [add
|
|
126
126
|
* authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
|
|
127
|
-
* method.
|
|
127
|
+
* method.
|
|
128
128
|
*
|
|
129
129
|
* @param {AuthenticatorType} type
|
|
130
130
|
* @param {string} otp
|
|
@@ -133,18 +133,17 @@ export declare class Account extends Service {
|
|
|
133
133
|
*/
|
|
134
134
|
updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
|
|
135
135
|
/**
|
|
136
|
-
* Delete
|
|
136
|
+
* Delete authenticator
|
|
137
137
|
*
|
|
138
138
|
* Delete an authenticator for a user by ID.
|
|
139
139
|
*
|
|
140
140
|
* @param {AuthenticatorType} type
|
|
141
|
-
* @param {string} otp
|
|
142
141
|
* @throws {AppwriteException}
|
|
143
142
|
* @returns {Promise}
|
|
144
143
|
*/
|
|
145
|
-
deleteMfaAuthenticator(type: AuthenticatorType
|
|
144
|
+
deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}>;
|
|
146
145
|
/**
|
|
147
|
-
* Create
|
|
146
|
+
* Create MFA challenge
|
|
148
147
|
*
|
|
149
148
|
* Begin the process of MFA verification after sign-in. Finish the flow with
|
|
150
149
|
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
@@ -156,7 +155,7 @@ export declare class Account extends Service {
|
|
|
156
155
|
*/
|
|
157
156
|
createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge>;
|
|
158
157
|
/**
|
|
159
|
-
* Create MFA
|
|
158
|
+
* Create MFA challenge (confirmation)
|
|
160
159
|
*
|
|
161
160
|
* Complete the MFA challenge by providing the one-time password. Finish the
|
|
162
161
|
* process of MFA verification by providing the one-time password. To begin
|
|
@@ -171,7 +170,7 @@ export declare class Account extends Service {
|
|
|
171
170
|
*/
|
|
172
171
|
updateMfaChallenge(challengeId: string, otp: string): Promise<{}>;
|
|
173
172
|
/**
|
|
174
|
-
* List
|
|
173
|
+
* List factors
|
|
175
174
|
*
|
|
176
175
|
* List the factors available on the account to be used as a MFA challange.
|
|
177
176
|
*
|
|
@@ -180,7 +179,7 @@ export declare class Account extends Service {
|
|
|
180
179
|
*/
|
|
181
180
|
listMfaFactors(): Promise<Models.MfaFactors>;
|
|
182
181
|
/**
|
|
183
|
-
* Get MFA
|
|
182
|
+
* Get MFA recovery codes
|
|
184
183
|
*
|
|
185
184
|
* Get recovery codes that can be used as backup for MFA flow. Before getting
|
|
186
185
|
* codes, they must be generated using
|
|
@@ -192,7 +191,7 @@ export declare class Account extends Service {
|
|
|
192
191
|
*/
|
|
193
192
|
getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
|
|
194
193
|
/**
|
|
195
|
-
* Create MFA
|
|
194
|
+
* Create MFA recovery codes
|
|
196
195
|
*
|
|
197
196
|
* Generate recovery codes as backup for MFA flow. It's recommended to
|
|
198
197
|
* generate and show then immediately after user successfully adds their
|
|
@@ -205,7 +204,7 @@ export declare class Account extends Service {
|
|
|
205
204
|
*/
|
|
206
205
|
createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
|
|
207
206
|
/**
|
|
208
|
-
* Regenerate MFA
|
|
207
|
+
* Regenerate MFA recovery codes
|
|
209
208
|
*
|
|
210
209
|
* Regenerate recovery codes that can be used as backup for MFA flow. Before
|
|
211
210
|
* regenerating codes, they must be first generated using
|
|
@@ -660,7 +659,7 @@ export declare class Account extends Service {
|
|
|
660
659
|
*/
|
|
661
660
|
createPhoneVerification(): Promise<Models.Token>;
|
|
662
661
|
/**
|
|
663
|
-
*
|
|
662
|
+
* Update phone verification (confirmation)
|
|
664
663
|
*
|
|
665
664
|
* Use this endpoint to complete the user phone verification process. Use the
|
|
666
665
|
* **userId** and **secret** that were sent to your user's phone number to
|
|
@@ -54,6 +54,7 @@ export declare class Avatars extends Service {
|
|
|
54
54
|
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
55
55
|
* website URL.
|
|
56
56
|
*
|
|
57
|
+
* This endpoint does not follow HTTP redirects.
|
|
57
58
|
*
|
|
58
59
|
* @param {string} url
|
|
59
60
|
* @throws {AppwriteException}
|
|
@@ -95,6 +96,7 @@ export declare class Avatars extends Service {
|
|
|
95
96
|
* image at source quality. If dimensions are not specified, the default size
|
|
96
97
|
* of image returned is 400x400px.
|
|
97
98
|
*
|
|
99
|
+
* This endpoint does not follow HTTP redirects.
|
|
98
100
|
*
|
|
99
101
|
* @param {string} url
|
|
100
102
|
* @param {number} width
|
|
@@ -31,10 +31,11 @@ export declare class Functions extends Service {
|
|
|
31
31
|
* @param {string} xpath
|
|
32
32
|
* @param {ExecutionMethod} method
|
|
33
33
|
* @param {object} headers
|
|
34
|
+
* @param {string} scheduledAt
|
|
34
35
|
* @throws {AppwriteException}
|
|
35
36
|
* @returns {Promise}
|
|
36
37
|
*/
|
|
37
|
-
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object): Promise<Models.Execution>;
|
|
38
|
+
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution>;
|
|
38
39
|
/**
|
|
39
40
|
* Get execution
|
|
40
41
|
*
|