@appwrite.io/console 0.5.0 → 0.6.0-rc.2
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 +1 -1
- package/dist/cjs/sdk.js +2100 -112
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +2100 -113
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +2100 -112
- package/docs/examples/account/add-authenticator.md +18 -0
- package/docs/examples/account/create-challenge.md +18 -0
- package/docs/examples/account/{delete.md → list-providers.md} +1 -1
- package/docs/examples/account/update-challenge.md +18 -0
- package/docs/examples/account/update-m-f-a.md +18 -0
- package/docs/examples/account/update-recovery.md +1 -1
- package/docs/examples/account/verify-authenticator.md +18 -0
- package/docs/examples/messaging/create-apns-provider.md +18 -0
- package/docs/examples/messaging/create-email-message.md +18 -0
- package/docs/examples/messaging/create-fcm-provider.md +18 -0
- package/docs/examples/messaging/create-mailgun-provider.md +18 -0
- package/docs/examples/messaging/create-msg91provider.md +18 -0
- package/docs/examples/messaging/create-push-message.md +18 -0
- package/docs/examples/messaging/create-s-m-s-message.md +18 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +18 -0
- package/docs/examples/messaging/create-subscriber.md +18 -0
- package/docs/examples/messaging/create-telesign-provider.md +18 -0
- package/docs/examples/messaging/create-textmagic-provider.md +18 -0
- package/docs/examples/messaging/create-topic.md +18 -0
- package/docs/examples/messaging/create-twilio-provider.md +18 -0
- package/docs/examples/messaging/create-vonage-provider.md +18 -0
- package/docs/examples/messaging/delete-provider.md +18 -0
- package/docs/examples/messaging/delete-subscriber.md +18 -0
- package/docs/examples/messaging/delete-topic.md +18 -0
- package/docs/examples/messaging/get-message.md +18 -0
- package/docs/examples/messaging/get-provider.md +18 -0
- package/docs/examples/messaging/get-subscriber.md +18 -0
- package/docs/examples/messaging/get-topic.md +18 -0
- package/docs/examples/messaging/list-message-logs.md +18 -0
- package/docs/examples/messaging/list-messages.md +18 -0
- package/docs/examples/messaging/list-provider-logs.md +18 -0
- package/docs/examples/messaging/list-providers.md +18 -0
- package/docs/examples/messaging/list-subscriber-logs.md +18 -0
- package/docs/examples/messaging/list-subscribers.md +18 -0
- package/docs/examples/messaging/list-topic-logs.md +18 -0
- package/docs/examples/messaging/list-topics.md +18 -0
- package/docs/examples/messaging/update-apns-provider.md +18 -0
- package/docs/examples/messaging/update-email.md +18 -0
- package/docs/examples/messaging/update-fcm-provider.md +18 -0
- package/docs/examples/messaging/update-mailgun-provider.md +18 -0
- package/docs/examples/messaging/update-msg91provider.md +18 -0
- package/docs/examples/messaging/update-push-notification.md +18 -0
- package/docs/examples/messaging/update-s-m-s.md +18 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +18 -0
- package/docs/examples/messaging/update-telesign-provider.md +18 -0
- package/docs/examples/messaging/update-textmagic-provider.md +18 -0
- package/docs/examples/messaging/update-topic.md +18 -0
- package/docs/examples/messaging/update-twilio-provider.md +18 -0
- package/docs/examples/messaging/update-vonage-provider.md +18 -0
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/projects/get-usage.md +18 -0
- package/docs/examples/projects/update-auth-mfa-factors.md +18 -0
- package/docs/examples/users/create-target.md +18 -0
- package/docs/examples/users/delete-target.md +18 -0
- package/docs/examples/users/get-target.md +18 -0
- package/docs/examples/users/list-targets.md +18 -0
- package/docs/examples/users/update-target.md +18 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/index.ts +1 -0
- package/src/models.ts +534 -199
- package/src/services/account.ts +158 -18
- package/src/services/functions.ts +1 -1
- package/src/services/messaging.ts +1901 -0
- package/src/services/project.ts +4 -22
- package/src/services/projects.ts +58 -0
- package/src/services/storage.ts +1 -1
- package/src/services/users.ts +188 -1
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +534 -199
- package/types/services/account.d.ts +56 -9
- package/types/services/functions.d.ts +1 -1
- package/types/services/messaging.d.ts +553 -0
- package/types/services/project.d.ts +2 -4
- package/types/services/projects.d.ts +20 -0
- package/types/services/storage.d.ts +1 -1
- package/types/services/users.d.ts +59 -1
package/src/services/account.ts
CHANGED
|
@@ -84,24 +84,6 @@ export class Account extends Service {
|
|
|
84
84
|
}, payload);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
/**
|
|
88
|
-
* Delete account
|
|
89
|
-
*
|
|
90
|
-
* Delete the currently logged in user.
|
|
91
|
-
*
|
|
92
|
-
* @throws {AppwriteException}
|
|
93
|
-
* @returns {Promise}
|
|
94
|
-
*/
|
|
95
|
-
async delete(): Promise<{}> {
|
|
96
|
-
const apiPath = '/account';
|
|
97
|
-
const payload: Payload = {};
|
|
98
|
-
|
|
99
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
100
|
-
return await this.client.call('delete', uri, {
|
|
101
|
-
'content-type': 'application/json',
|
|
102
|
-
}, payload);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
87
|
/**
|
|
106
88
|
* Update email
|
|
107
89
|
*
|
|
@@ -237,6 +219,164 @@ export class Account extends Service {
|
|
|
237
219
|
}, payload);
|
|
238
220
|
}
|
|
239
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Update MFA
|
|
224
|
+
*
|
|
225
|
+
*
|
|
226
|
+
* @param {boolean} mfa
|
|
227
|
+
* @throws {AppwriteException}
|
|
228
|
+
* @returns {Promise}
|
|
229
|
+
*/
|
|
230
|
+
async updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>> {
|
|
231
|
+
if (typeof mfa === 'undefined') {
|
|
232
|
+
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const apiPath = '/account/mfa';
|
|
236
|
+
const payload: Payload = {};
|
|
237
|
+
|
|
238
|
+
if (typeof mfa !== 'undefined') {
|
|
239
|
+
payload['mfa'] = mfa;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
243
|
+
return await this.client.call('patch', uri, {
|
|
244
|
+
'content-type': 'application/json',
|
|
245
|
+
}, payload);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Create MFA Challenge
|
|
250
|
+
*
|
|
251
|
+
*
|
|
252
|
+
* @param {string} provider
|
|
253
|
+
* @throws {AppwriteException}
|
|
254
|
+
* @returns {Promise}
|
|
255
|
+
*/
|
|
256
|
+
async createChallenge(provider: string): Promise<Models.MfaChallenge> {
|
|
257
|
+
if (typeof provider === 'undefined') {
|
|
258
|
+
throw new AppwriteException('Missing required parameter: "provider"');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const apiPath = '/account/mfa/challenge';
|
|
262
|
+
const payload: Payload = {};
|
|
263
|
+
|
|
264
|
+
if (typeof provider !== 'undefined') {
|
|
265
|
+
payload['provider'] = provider;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
269
|
+
return await this.client.call('post', uri, {
|
|
270
|
+
'content-type': 'application/json',
|
|
271
|
+
}, payload);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Create MFA Challenge (confirmation)
|
|
276
|
+
*
|
|
277
|
+
*
|
|
278
|
+
* @param {string} challengeId
|
|
279
|
+
* @param {string} otp
|
|
280
|
+
* @throws {AppwriteException}
|
|
281
|
+
* @returns {Promise}
|
|
282
|
+
*/
|
|
283
|
+
async updateChallenge(challengeId: string, otp: string): Promise<{}> {
|
|
284
|
+
if (typeof challengeId === 'undefined') {
|
|
285
|
+
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (typeof otp === 'undefined') {
|
|
289
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const apiPath = '/account/mfa/challenge';
|
|
293
|
+
const payload: Payload = {};
|
|
294
|
+
|
|
295
|
+
if (typeof challengeId !== 'undefined') {
|
|
296
|
+
payload['challengeId'] = challengeId;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (typeof otp !== 'undefined') {
|
|
300
|
+
payload['otp'] = otp;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
304
|
+
return await this.client.call('put', uri, {
|
|
305
|
+
'content-type': 'application/json',
|
|
306
|
+
}, payload);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* List Providers
|
|
311
|
+
*
|
|
312
|
+
* Get the currently logged in user.
|
|
313
|
+
*
|
|
314
|
+
* @throws {AppwriteException}
|
|
315
|
+
* @returns {Promise}
|
|
316
|
+
*/
|
|
317
|
+
async listProviders(): Promise<Models.MfaProviders> {
|
|
318
|
+
const apiPath = '/account/mfa/providers';
|
|
319
|
+
const payload: Payload = {};
|
|
320
|
+
|
|
321
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
322
|
+
return await this.client.call('get', uri, {
|
|
323
|
+
'content-type': 'application/json',
|
|
324
|
+
}, payload);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Add Authenticator
|
|
329
|
+
*
|
|
330
|
+
*
|
|
331
|
+
* @param {string} provider
|
|
332
|
+
* @throws {AppwriteException}
|
|
333
|
+
* @returns {Promise}
|
|
334
|
+
*/
|
|
335
|
+
async addAuthenticator(provider: string): Promise<Models.MfaProvider> {
|
|
336
|
+
if (typeof provider === 'undefined') {
|
|
337
|
+
throw new AppwriteException('Missing required parameter: "provider"');
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const apiPath = '/account/mfa/{provider}'.replace('{provider}', provider);
|
|
341
|
+
const payload: Payload = {};
|
|
342
|
+
|
|
343
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
344
|
+
return await this.client.call('post', uri, {
|
|
345
|
+
'content-type': 'application/json',
|
|
346
|
+
}, payload);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Verify Authenticator
|
|
351
|
+
*
|
|
352
|
+
*
|
|
353
|
+
* @param {string} provider
|
|
354
|
+
* @param {string} otp
|
|
355
|
+
* @throws {AppwriteException}
|
|
356
|
+
* @returns {Promise}
|
|
357
|
+
*/
|
|
358
|
+
async verifyAuthenticator<Preferences extends Models.Preferences>(provider: string, otp: string): Promise<Models.User<Preferences>> {
|
|
359
|
+
if (typeof provider === 'undefined') {
|
|
360
|
+
throw new AppwriteException('Missing required parameter: "provider"');
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (typeof otp === 'undefined') {
|
|
364
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const apiPath = '/account/mfa/{provider}'.replace('{provider}', provider);
|
|
368
|
+
const payload: Payload = {};
|
|
369
|
+
|
|
370
|
+
if (typeof otp !== 'undefined') {
|
|
371
|
+
payload['otp'] = otp;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
375
|
+
return await this.client.call('put', uri, {
|
|
376
|
+
'content-type': 'application/json',
|
|
377
|
+
}, payload);
|
|
378
|
+
}
|
|
379
|
+
|
|
240
380
|
/**
|
|
241
381
|
* Update name
|
|
242
382
|
*
|
|
@@ -770,7 +770,7 @@ export class Functions extends Service {
|
|
|
770
770
|
* @throws {AppwriteException}
|
|
771
771
|
* @returns {Promise}
|
|
772
772
|
*/
|
|
773
|
-
async getFunctionUsage(functionId: string, range?: string): Promise<Models.
|
|
773
|
+
async getFunctionUsage(functionId: string, range?: string): Promise<Models.UsageFunctions> {
|
|
774
774
|
if (typeof functionId === 'undefined') {
|
|
775
775
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
776
776
|
}
|