react-native-appwrite 0.11.0 → 0.13.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 +84 -3
- package/dist/cjs/sdk.js +1854 -1121
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1854 -1122
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-email-password-session.md +4 -4
- package/docs/examples/account/create-email-token.md +5 -5
- package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
- package/docs/examples/account/create-mfa-authenticator.md +3 -3
- package/docs/examples/account/create-mfa-challenge.md +3 -3
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
- package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
- package/docs/examples/account/create-phone-token.md +4 -4
- package/docs/examples/account/create-push-target.md +5 -5
- package/docs/examples/account/create-recovery.md +4 -4
- package/docs/examples/account/create-session.md +4 -4
- package/docs/examples/account/create-verification.md +3 -3
- package/docs/examples/account/create.md +6 -6
- package/docs/examples/account/delete-identity.md +3 -3
- package/docs/examples/account/delete-mfa-authenticator.md +3 -3
- package/docs/examples/account/delete-push-target.md +3 -3
- package/docs/examples/account/delete-session.md +3 -3
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-session.md +3 -3
- package/docs/examples/account/list-identities.md +3 -3
- package/docs/examples/account/list-logs.md +3 -3
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/update-email.md +4 -4
- package/docs/examples/account/{update-magic-u-r-l-session.md → update-magic-url-session.md} +4 -4
- package/docs/examples/account/update-mfa-authenticator.md +4 -4
- package/docs/examples/account/update-mfa-challenge.md +4 -4
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{update-m-f-a.md → update-mfa.md} +3 -3
- package/docs/examples/account/update-name.md +3 -3
- package/docs/examples/account/update-password.md +4 -4
- package/docs/examples/account/update-phone-session.md +4 -4
- package/docs/examples/account/update-phone-verification.md +4 -4
- package/docs/examples/account/update-phone.md +4 -4
- package/docs/examples/account/update-prefs.md +7 -3
- package/docs/examples/account/update-push-target.md +4 -4
- package/docs/examples/account/update-recovery.md +5 -5
- package/docs/examples/account/update-session.md +3 -3
- package/docs/examples/account/update-verification.md +4 -4
- package/docs/examples/avatars/get-browser.md +6 -6
- package/docs/examples/avatars/get-credit-card.md +6 -6
- package/docs/examples/avatars/get-favicon.md +3 -3
- package/docs/examples/avatars/get-flag.md +6 -6
- package/docs/examples/avatars/get-image.md +5 -5
- package/docs/examples/avatars/get-initials.md +6 -6
- package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
- package/docs/examples/databases/create-document.md +13 -7
- package/docs/examples/databases/decrement-document-attribute.md +8 -8
- package/docs/examples/databases/delete-document.md +5 -5
- package/docs/examples/databases/get-document.md +6 -6
- package/docs/examples/databases/increment-document-attribute.md +8 -8
- package/docs/examples/databases/list-documents.md +5 -5
- package/docs/examples/databases/update-document.md +7 -7
- package/docs/examples/databases/upsert-document.md +7 -7
- package/docs/examples/functions/create-execution.md +9 -9
- package/docs/examples/functions/get-execution.md +4 -4
- package/docs/examples/functions/list-executions.md +4 -4
- package/docs/examples/graphql/mutation.md +3 -3
- package/docs/examples/graphql/query.md +3 -3
- package/docs/examples/messaging/create-subscriber.md +5 -5
- package/docs/examples/messaging/delete-subscriber.md +4 -4
- package/docs/examples/storage/create-file.md +6 -6
- package/docs/examples/storage/delete-file.md +4 -4
- package/docs/examples/storage/get-file-download.md +5 -5
- package/docs/examples/storage/get-file-preview.md +16 -16
- package/docs/examples/storage/get-file-view.md +5 -5
- package/docs/examples/storage/get-file.md +4 -4
- package/docs/examples/storage/list-files.md +5 -5
- package/docs/examples/storage/update-file.md +6 -6
- package/docs/examples/tablesdb/create-row.md +23 -0
- package/docs/examples/tablesdb/decrement-row-column.md +18 -0
- package/docs/examples/tablesdb/delete-row.md +15 -0
- package/docs/examples/tablesdb/get-row.md +16 -0
- package/docs/examples/tablesdb/increment-row-column.md +18 -0
- package/docs/examples/tablesdb/list-rows.md +15 -0
- package/docs/examples/tablesdb/update-row.md +17 -0
- package/docs/examples/tablesdb/upsert-row.md +17 -0
- package/docs/examples/teams/create-membership.md +9 -9
- package/docs/examples/teams/create.md +5 -5
- package/docs/examples/teams/delete-membership.md +4 -4
- package/docs/examples/teams/delete.md +3 -3
- package/docs/examples/teams/get-membership.md +4 -4
- package/docs/examples/teams/get-prefs.md +3 -3
- package/docs/examples/teams/get.md +3 -3
- package/docs/examples/teams/list-memberships.md +5 -5
- package/docs/examples/teams/list.md +4 -4
- package/docs/examples/teams/update-membership-status.md +6 -6
- package/docs/examples/teams/update-membership.md +5 -5
- package/docs/examples/teams/update-name.md +4 -4
- package/docs/examples/teams/update-prefs.md +4 -4
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/enums/credit-card.ts +1 -1
- package/src/enums/execution-method.ts +1 -0
- package/src/index.ts +1 -0
- package/src/models.ts +72 -27
- package/src/query.ts +247 -4
- package/src/services/account.ts +1469 -315
- package/src/services/avatars.ts +289 -80
- package/src/services/databases.ts +345 -63
- package/src/services/functions.ts +115 -20
- package/src/services/graphql.ts +52 -4
- package/src/services/locale.ts +8 -19
- package/src/services/messaging.ts +66 -7
- package/src/services/storage.ts +345 -76
- package/src/services/tables-db.ts +621 -0
- package/src/services/teams.ts +454 -93
- package/types/enums/credit-card.d.ts +1 -1
- package/types/enums/execution-method.d.ts +2 -1
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +69 -25
- package/types/query.d.ts +201 -4
- package/types/services/account.d.ts +734 -280
- package/types/services/avatars.d.ts +168 -73
- package/types/services/databases.d.ts +199 -58
- package/types/services/functions.d.ts +62 -17
- package/types/services/graphql.d.ts +24 -2
- package/types/services/locale.d.ts +8 -19
- package/types/services/messaging.d.ts +33 -5
- package/types/services/storage.d.ts +201 -68
- package/types/services/tables-db.d.ts +245 -0
- package/types/services/teams.d.ts +242 -80
- /package/docs/examples/account/{create-j-w-t.md → create-jwt.md} +0 -0
- /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
package/dist/esm/sdk.js
CHANGED
|
@@ -78,8 +78,8 @@ class Client {
|
|
|
78
78
|
'x-sdk-name': 'React Native',
|
|
79
79
|
'x-sdk-platform': 'client',
|
|
80
80
|
'x-sdk-language': 'reactnative',
|
|
81
|
-
'x-sdk-version': '0.
|
|
82
|
-
'X-Appwrite-Response-Format': '1.
|
|
81
|
+
'x-sdk-version': '0.13.0',
|
|
82
|
+
'X-Appwrite-Response-Format': '1.8.0',
|
|
83
83
|
};
|
|
84
84
|
this.realtime = {
|
|
85
85
|
socket: undefined,
|
|
@@ -470,23 +470,23 @@ class Account extends Service {
|
|
|
470
470
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
471
471
|
return this.client.call('get', uri, {}, payload);
|
|
472
472
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
473
|
+
create(paramsOrFirst, ...rest) {
|
|
474
|
+
let params;
|
|
475
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
476
|
+
params = (paramsOrFirst || {});
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
params = {
|
|
480
|
+
userId: paramsOrFirst,
|
|
481
|
+
email: rest[0],
|
|
482
|
+
password: rest[1],
|
|
483
|
+
name: rest[2]
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
const userId = params.userId;
|
|
487
|
+
const email = params.email;
|
|
488
|
+
const password = params.password;
|
|
489
|
+
const name = params.name;
|
|
490
490
|
if (typeof userId === 'undefined') {
|
|
491
491
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
492
492
|
}
|
|
@@ -515,22 +515,19 @@ class Account extends Service {
|
|
|
515
515
|
'content-type': 'application/json',
|
|
516
516
|
}, payload);
|
|
517
517
|
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
* @returns {Promise}
|
|
532
|
-
*/
|
|
533
|
-
updateEmail(email, password) {
|
|
518
|
+
updateEmail(paramsOrFirst, ...rest) {
|
|
519
|
+
let params;
|
|
520
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
521
|
+
params = (paramsOrFirst || {});
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
params = {
|
|
525
|
+
email: paramsOrFirst,
|
|
526
|
+
password: rest[0]
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
const email = params.email;
|
|
530
|
+
const password = params.password;
|
|
534
531
|
if (typeof email === 'undefined') {
|
|
535
532
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
536
533
|
}
|
|
@@ -550,14 +547,17 @@ class Account extends Service {
|
|
|
550
547
|
'content-type': 'application/json',
|
|
551
548
|
}, payload);
|
|
552
549
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
550
|
+
listIdentities(paramsOrFirst) {
|
|
551
|
+
let params;
|
|
552
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
553
|
+
params = (paramsOrFirst || {});
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
params = {
|
|
557
|
+
queries: paramsOrFirst
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
const queries = params.queries;
|
|
561
561
|
const apiPath = '/account/identities';
|
|
562
562
|
const payload = {};
|
|
563
563
|
if (typeof queries !== 'undefined') {
|
|
@@ -566,14 +566,17 @@ class Account extends Service {
|
|
|
566
566
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
567
567
|
return this.client.call('get', uri, {}, payload);
|
|
568
568
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
569
|
+
deleteIdentity(paramsOrFirst) {
|
|
570
|
+
let params;
|
|
571
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
572
|
+
params = (paramsOrFirst || {});
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
params = {
|
|
576
|
+
identityId: paramsOrFirst
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
const identityId = params.identityId;
|
|
577
580
|
if (typeof identityId === 'undefined') {
|
|
578
581
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
579
582
|
}
|
|
@@ -585,11 +588,7 @@ class Account extends Service {
|
|
|
585
588
|
}, payload);
|
|
586
589
|
}
|
|
587
590
|
/**
|
|
588
|
-
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT
|
|
589
|
-
* to authenticate on behalf of the current user when working with the
|
|
590
|
-
* Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes
|
|
591
|
-
* from its creation and will be invalid if the user will logout in that time
|
|
592
|
-
* frame.
|
|
591
|
+
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
|
|
593
592
|
*
|
|
594
593
|
* @throws {AppwriteException}
|
|
595
594
|
* @returns {Promise}
|
|
@@ -602,15 +601,17 @@ class Account extends Service {
|
|
|
602
601
|
'content-type': 'application/json',
|
|
603
602
|
}, payload);
|
|
604
603
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
604
|
+
listLogs(paramsOrFirst) {
|
|
605
|
+
let params;
|
|
606
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
607
|
+
params = (paramsOrFirst || {});
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
params = {
|
|
611
|
+
queries: paramsOrFirst
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
const queries = params.queries;
|
|
614
615
|
const apiPath = '/account/logs';
|
|
615
616
|
const payload = {};
|
|
616
617
|
if (typeof queries !== 'undefined') {
|
|
@@ -619,14 +620,17 @@ class Account extends Service {
|
|
|
619
620
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
620
621
|
return this.client.call('get', uri, {}, payload);
|
|
621
622
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
623
|
+
updateMFA(paramsOrFirst) {
|
|
624
|
+
let params;
|
|
625
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
626
|
+
params = (paramsOrFirst || {});
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
params = {
|
|
630
|
+
mfa: paramsOrFirst
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
const mfa = params.mfa;
|
|
630
634
|
if (typeof mfa === 'undefined') {
|
|
631
635
|
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
632
636
|
}
|
|
@@ -640,17 +644,17 @@ class Account extends Service {
|
|
|
640
644
|
'content-type': 'application/json',
|
|
641
645
|
}, payload);
|
|
642
646
|
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
647
|
+
createMfaAuthenticator(paramsOrFirst) {
|
|
648
|
+
let params;
|
|
649
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
650
|
+
params = (paramsOrFirst || {});
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
params = {
|
|
654
|
+
type: paramsOrFirst
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
const type = params.type;
|
|
654
658
|
if (typeof type === 'undefined') {
|
|
655
659
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
656
660
|
}
|
|
@@ -661,17 +665,40 @@ class Account extends Service {
|
|
|
661
665
|
'content-type': 'application/json',
|
|
662
666
|
}, payload);
|
|
663
667
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
668
|
+
createMFAAuthenticator(paramsOrFirst) {
|
|
669
|
+
let params;
|
|
670
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
671
|
+
params = (paramsOrFirst || {});
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
params = {
|
|
675
|
+
type: paramsOrFirst
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
const type = params.type;
|
|
679
|
+
if (typeof type === 'undefined') {
|
|
680
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
681
|
+
}
|
|
682
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
683
|
+
const payload = {};
|
|
684
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
685
|
+
return this.client.call('post', uri, {
|
|
686
|
+
'content-type': 'application/json',
|
|
687
|
+
}, payload);
|
|
688
|
+
}
|
|
689
|
+
updateMfaAuthenticator(paramsOrFirst, ...rest) {
|
|
690
|
+
let params;
|
|
691
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
692
|
+
params = (paramsOrFirst || {});
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
params = {
|
|
696
|
+
type: paramsOrFirst,
|
|
697
|
+
otp: rest[0]
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
const type = params.type;
|
|
701
|
+
const otp = params.otp;
|
|
675
702
|
if (typeof type === 'undefined') {
|
|
676
703
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
677
704
|
}
|
|
@@ -688,14 +715,46 @@ class Account extends Service {
|
|
|
688
715
|
'content-type': 'application/json',
|
|
689
716
|
}, payload);
|
|
690
717
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
718
|
+
updateMFAAuthenticator(paramsOrFirst, ...rest) {
|
|
719
|
+
let params;
|
|
720
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
721
|
+
params = (paramsOrFirst || {});
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
params = {
|
|
725
|
+
type: paramsOrFirst,
|
|
726
|
+
otp: rest[0]
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
const type = params.type;
|
|
730
|
+
const otp = params.otp;
|
|
731
|
+
if (typeof type === 'undefined') {
|
|
732
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
733
|
+
}
|
|
734
|
+
if (typeof otp === 'undefined') {
|
|
735
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
736
|
+
}
|
|
737
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
738
|
+
const payload = {};
|
|
739
|
+
if (typeof otp !== 'undefined') {
|
|
740
|
+
payload['otp'] = otp;
|
|
741
|
+
}
|
|
742
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
743
|
+
return this.client.call('put', uri, {
|
|
744
|
+
'content-type': 'application/json',
|
|
745
|
+
}, payload);
|
|
746
|
+
}
|
|
747
|
+
deleteMfaAuthenticator(paramsOrFirst) {
|
|
748
|
+
let params;
|
|
749
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
750
|
+
params = (paramsOrFirst || {});
|
|
751
|
+
}
|
|
752
|
+
else {
|
|
753
|
+
params = {
|
|
754
|
+
type: paramsOrFirst
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
const type = params.type;
|
|
699
758
|
if (typeof type === 'undefined') {
|
|
700
759
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
701
760
|
}
|
|
@@ -706,16 +765,38 @@ class Account extends Service {
|
|
|
706
765
|
'content-type': 'application/json',
|
|
707
766
|
}, payload);
|
|
708
767
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
768
|
+
deleteMFAAuthenticator(paramsOrFirst) {
|
|
769
|
+
let params;
|
|
770
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
771
|
+
params = (paramsOrFirst || {});
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
params = {
|
|
775
|
+
type: paramsOrFirst
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
const type = params.type;
|
|
779
|
+
if (typeof type === 'undefined') {
|
|
780
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
781
|
+
}
|
|
782
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
783
|
+
const payload = {};
|
|
784
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
785
|
+
return this.client.call('delete', uri, {
|
|
786
|
+
'content-type': 'application/json',
|
|
787
|
+
}, payload);
|
|
788
|
+
}
|
|
789
|
+
createMfaChallenge(paramsOrFirst) {
|
|
790
|
+
let params;
|
|
791
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
792
|
+
params = (paramsOrFirst || {});
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
params = {
|
|
796
|
+
factor: paramsOrFirst
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
const factor = params.factor;
|
|
719
800
|
if (typeof factor === 'undefined') {
|
|
720
801
|
throw new AppwriteException('Missing required parameter: "factor"');
|
|
721
802
|
}
|
|
@@ -729,19 +810,75 @@ class Account extends Service {
|
|
|
729
810
|
'content-type': 'application/json',
|
|
730
811
|
}, payload);
|
|
731
812
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
813
|
+
createMFAChallenge(paramsOrFirst) {
|
|
814
|
+
let params;
|
|
815
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
816
|
+
params = (paramsOrFirst || {});
|
|
817
|
+
}
|
|
818
|
+
else {
|
|
819
|
+
params = {
|
|
820
|
+
factor: paramsOrFirst
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
const factor = params.factor;
|
|
824
|
+
if (typeof factor === 'undefined') {
|
|
825
|
+
throw new AppwriteException('Missing required parameter: "factor"');
|
|
826
|
+
}
|
|
827
|
+
const apiPath = '/account/mfa/challenge';
|
|
828
|
+
const payload = {};
|
|
829
|
+
if (typeof factor !== 'undefined') {
|
|
830
|
+
payload['factor'] = factor;
|
|
831
|
+
}
|
|
832
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
833
|
+
return this.client.call('post', uri, {
|
|
834
|
+
'content-type': 'application/json',
|
|
835
|
+
}, payload);
|
|
836
|
+
}
|
|
837
|
+
updateMfaChallenge(paramsOrFirst, ...rest) {
|
|
838
|
+
let params;
|
|
839
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
840
|
+
params = (paramsOrFirst || {});
|
|
841
|
+
}
|
|
842
|
+
else {
|
|
843
|
+
params = {
|
|
844
|
+
challengeId: paramsOrFirst,
|
|
845
|
+
otp: rest[0]
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
const challengeId = params.challengeId;
|
|
849
|
+
const otp = params.otp;
|
|
850
|
+
if (typeof challengeId === 'undefined') {
|
|
851
|
+
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
852
|
+
}
|
|
853
|
+
if (typeof otp === 'undefined') {
|
|
854
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
855
|
+
}
|
|
856
|
+
const apiPath = '/account/mfa/challenge';
|
|
857
|
+
const payload = {};
|
|
858
|
+
if (typeof challengeId !== 'undefined') {
|
|
859
|
+
payload['challengeId'] = challengeId;
|
|
860
|
+
}
|
|
861
|
+
if (typeof otp !== 'undefined') {
|
|
862
|
+
payload['otp'] = otp;
|
|
863
|
+
}
|
|
864
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
865
|
+
return this.client.call('put', uri, {
|
|
866
|
+
'content-type': 'application/json',
|
|
867
|
+
}, payload);
|
|
868
|
+
}
|
|
869
|
+
updateMFAChallenge(paramsOrFirst, ...rest) {
|
|
870
|
+
let params;
|
|
871
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
872
|
+
params = (paramsOrFirst || {});
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
params = {
|
|
876
|
+
challengeId: paramsOrFirst,
|
|
877
|
+
otp: rest[0]
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
const challengeId = params.challengeId;
|
|
881
|
+
const otp = params.otp;
|
|
745
882
|
if (typeof challengeId === 'undefined') {
|
|
746
883
|
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
747
884
|
}
|
|
@@ -766,6 +903,7 @@ class Account extends Service {
|
|
|
766
903
|
*
|
|
767
904
|
* @throws {AppwriteException}
|
|
768
905
|
* @returns {Promise}
|
|
906
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Account.listMFAFactors` instead.
|
|
769
907
|
*/
|
|
770
908
|
listMfaFactors() {
|
|
771
909
|
const apiPath = '/account/mfa/factors';
|
|
@@ -774,13 +912,23 @@ class Account extends Service {
|
|
|
774
912
|
return this.client.call('get', uri, {}, payload);
|
|
775
913
|
}
|
|
776
914
|
/**
|
|
777
|
-
*
|
|
778
|
-
*
|
|
779
|
-
*
|
|
780
|
-
*
|
|
915
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
916
|
+
*
|
|
917
|
+
* @throws {AppwriteException}
|
|
918
|
+
* @returns {Promise}
|
|
919
|
+
*/
|
|
920
|
+
listMFAFactors() {
|
|
921
|
+
const apiPath = '/account/mfa/factors';
|
|
922
|
+
const payload = {};
|
|
923
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
924
|
+
return this.client.call('get', uri, {}, payload);
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
|
|
781
928
|
*
|
|
782
929
|
* @throws {AppwriteException}
|
|
783
930
|
* @returns {Promise}
|
|
931
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Account.getMFARecoveryCodes` instead.
|
|
784
932
|
*/
|
|
785
933
|
getMfaRecoveryCodes() {
|
|
786
934
|
const apiPath = '/account/mfa/recovery-codes';
|
|
@@ -789,14 +937,23 @@ class Account extends Service {
|
|
|
789
937
|
return this.client.call('get', uri, {}, payload);
|
|
790
938
|
}
|
|
791
939
|
/**
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
*
|
|
795
|
-
*
|
|
796
|
-
|
|
940
|
+
* Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
|
|
941
|
+
*
|
|
942
|
+
* @throws {AppwriteException}
|
|
943
|
+
* @returns {Promise}
|
|
944
|
+
*/
|
|
945
|
+
getMFARecoveryCodes() {
|
|
946
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
947
|
+
const payload = {};
|
|
948
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
949
|
+
return this.client.call('get', uri, {}, payload);
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
|
|
797
953
|
*
|
|
798
954
|
* @throws {AppwriteException}
|
|
799
955
|
* @returns {Promise}
|
|
956
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFARecoveryCodes` instead.
|
|
800
957
|
*/
|
|
801
958
|
createMfaRecoveryCodes() {
|
|
802
959
|
const apiPath = '/account/mfa/recovery-codes';
|
|
@@ -807,13 +964,25 @@ class Account extends Service {
|
|
|
807
964
|
}, payload);
|
|
808
965
|
}
|
|
809
966
|
/**
|
|
810
|
-
*
|
|
811
|
-
*
|
|
812
|
-
*
|
|
813
|
-
*
|
|
967
|
+
* Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
|
|
968
|
+
*
|
|
969
|
+
* @throws {AppwriteException}
|
|
970
|
+
* @returns {Promise}
|
|
971
|
+
*/
|
|
972
|
+
createMFARecoveryCodes() {
|
|
973
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
974
|
+
const payload = {};
|
|
975
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
976
|
+
return this.client.call('post', uri, {
|
|
977
|
+
'content-type': 'application/json',
|
|
978
|
+
}, payload);
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
|
|
814
982
|
*
|
|
815
983
|
* @throws {AppwriteException}
|
|
816
984
|
* @returns {Promise}
|
|
985
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFARecoveryCodes` instead.
|
|
817
986
|
*/
|
|
818
987
|
updateMfaRecoveryCodes() {
|
|
819
988
|
const apiPath = '/account/mfa/recovery-codes';
|
|
@@ -824,13 +993,30 @@ class Account extends Service {
|
|
|
824
993
|
}, payload);
|
|
825
994
|
}
|
|
826
995
|
/**
|
|
827
|
-
*
|
|
996
|
+
* Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
|
|
828
997
|
*
|
|
829
|
-
* @param {string} name
|
|
830
998
|
* @throws {AppwriteException}
|
|
831
999
|
* @returns {Promise}
|
|
832
1000
|
*/
|
|
833
|
-
|
|
1001
|
+
updateMFARecoveryCodes() {
|
|
1002
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
1003
|
+
const payload = {};
|
|
1004
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1005
|
+
return this.client.call('patch', uri, {
|
|
1006
|
+
'content-type': 'application/json',
|
|
1007
|
+
}, payload);
|
|
1008
|
+
}
|
|
1009
|
+
updateName(paramsOrFirst) {
|
|
1010
|
+
let params;
|
|
1011
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1012
|
+
params = (paramsOrFirst || {});
|
|
1013
|
+
}
|
|
1014
|
+
else {
|
|
1015
|
+
params = {
|
|
1016
|
+
name: paramsOrFirst
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
const name = params.name;
|
|
834
1020
|
if (typeof name === 'undefined') {
|
|
835
1021
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
836
1022
|
}
|
|
@@ -844,17 +1030,19 @@ class Account extends Service {
|
|
|
844
1030
|
'content-type': 'application/json',
|
|
845
1031
|
}, payload);
|
|
846
1032
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1033
|
+
updatePassword(paramsOrFirst, ...rest) {
|
|
1034
|
+
let params;
|
|
1035
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1036
|
+
params = (paramsOrFirst || {});
|
|
1037
|
+
}
|
|
1038
|
+
else {
|
|
1039
|
+
params = {
|
|
1040
|
+
password: paramsOrFirst,
|
|
1041
|
+
oldPassword: rest[0]
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
const password = params.password;
|
|
1045
|
+
const oldPassword = params.oldPassword;
|
|
858
1046
|
if (typeof password === 'undefined') {
|
|
859
1047
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
860
1048
|
}
|
|
@@ -871,19 +1059,19 @@ class Account extends Service {
|
|
|
871
1059
|
'content-type': 'application/json',
|
|
872
1060
|
}, payload);
|
|
873
1061
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1062
|
+
updatePhone(paramsOrFirst, ...rest) {
|
|
1063
|
+
let params;
|
|
1064
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1065
|
+
params = (paramsOrFirst || {});
|
|
1066
|
+
}
|
|
1067
|
+
else {
|
|
1068
|
+
params = {
|
|
1069
|
+
phone: paramsOrFirst,
|
|
1070
|
+
password: rest[0]
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
const phone = params.phone;
|
|
1074
|
+
const password = params.password;
|
|
887
1075
|
if (typeof phone === 'undefined') {
|
|
888
1076
|
throw new AppwriteException('Missing required parameter: "phone"');
|
|
889
1077
|
}
|
|
@@ -915,16 +1103,17 @@ class Account extends Service {
|
|
|
915
1103
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
916
1104
|
return this.client.call('get', uri, {}, payload);
|
|
917
1105
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
1106
|
+
updatePrefs(paramsOrFirst) {
|
|
1107
|
+
let params;
|
|
1108
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'prefs' in paramsOrFirst)) {
|
|
1109
|
+
params = (paramsOrFirst || {});
|
|
1110
|
+
}
|
|
1111
|
+
else {
|
|
1112
|
+
params = {
|
|
1113
|
+
prefs: paramsOrFirst
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
const prefs = params.prefs;
|
|
928
1117
|
if (typeof prefs === 'undefined') {
|
|
929
1118
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
930
1119
|
}
|
|
@@ -938,22 +1127,19 @@ class Account extends Service {
|
|
|
938
1127
|
'content-type': 'application/json',
|
|
939
1128
|
}, payload);
|
|
940
1129
|
}
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
* @returns {Promise}
|
|
955
|
-
*/
|
|
956
|
-
createRecovery(email, url) {
|
|
1130
|
+
createRecovery(paramsOrFirst, ...rest) {
|
|
1131
|
+
let params;
|
|
1132
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1133
|
+
params = (paramsOrFirst || {});
|
|
1134
|
+
}
|
|
1135
|
+
else {
|
|
1136
|
+
params = {
|
|
1137
|
+
email: paramsOrFirst,
|
|
1138
|
+
url: rest[0]
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
const email = params.email;
|
|
1142
|
+
const url = params.url;
|
|
957
1143
|
if (typeof email === 'undefined') {
|
|
958
1144
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
959
1145
|
}
|
|
@@ -973,26 +1159,22 @@ class Account extends Service {
|
|
|
973
1159
|
'content-type': 'application/json',
|
|
974
1160
|
}, payload);
|
|
975
1161
|
}
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
* @returns {Promise}
|
|
993
|
-
*/
|
|
994
|
-
updateRecovery(userId, secret, password) {
|
|
995
|
-
if (typeof userId === 'undefined') {
|
|
1162
|
+
updateRecovery(paramsOrFirst, ...rest) {
|
|
1163
|
+
let params;
|
|
1164
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1165
|
+
params = (paramsOrFirst || {});
|
|
1166
|
+
}
|
|
1167
|
+
else {
|
|
1168
|
+
params = {
|
|
1169
|
+
userId: paramsOrFirst,
|
|
1170
|
+
secret: rest[0],
|
|
1171
|
+
password: rest[1]
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
const userId = params.userId;
|
|
1175
|
+
const secret = params.secret;
|
|
1176
|
+
const password = params.password;
|
|
1177
|
+
if (typeof userId === 'undefined') {
|
|
996
1178
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
997
1179
|
}
|
|
998
1180
|
if (typeof secret === 'undefined') {
|
|
@@ -1018,8 +1200,7 @@ class Account extends Service {
|
|
|
1018
1200
|
}, payload);
|
|
1019
1201
|
}
|
|
1020
1202
|
/**
|
|
1021
|
-
* Get the list of active sessions across different devices for the currently
|
|
1022
|
-
* logged in user.
|
|
1203
|
+
* Get the list of active sessions across different devices for the currently logged in user.
|
|
1023
1204
|
*
|
|
1024
1205
|
* @throws {AppwriteException}
|
|
1025
1206
|
* @returns {Promise}
|
|
@@ -1031,8 +1212,7 @@ class Account extends Service {
|
|
|
1031
1212
|
return this.client.call('get', uri, {}, payload);
|
|
1032
1213
|
}
|
|
1033
1214
|
/**
|
|
1034
|
-
* Delete all sessions from the user account and remove any sessions cookies
|
|
1035
|
-
* from the end client.
|
|
1215
|
+
* Delete all sessions from the user account and remove any sessions cookies from the end client.
|
|
1036
1216
|
*
|
|
1037
1217
|
* @throws {AppwriteException}
|
|
1038
1218
|
* @returns {Promise}
|
|
@@ -1046,13 +1226,7 @@ class Account extends Service {
|
|
|
1046
1226
|
}, payload);
|
|
1047
1227
|
}
|
|
1048
1228
|
/**
|
|
1049
|
-
* Use this endpoint to allow a new user to register an anonymous account in
|
|
1050
|
-
* your project. This route will also create a new session for the user. To
|
|
1051
|
-
* allow the new user to convert an anonymous account to a normal account, you
|
|
1052
|
-
* need to update its [email and
|
|
1053
|
-
* password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail)
|
|
1054
|
-
* or create an [OAuth2
|
|
1055
|
-
* session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
|
|
1229
|
+
* Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
|
|
1056
1230
|
*
|
|
1057
1231
|
* @throws {AppwriteException}
|
|
1058
1232
|
* @returns {Promise}
|
|
@@ -1065,20 +1239,19 @@ class Account extends Service {
|
|
|
1065
1239
|
'content-type': 'application/json',
|
|
1066
1240
|
}, payload);
|
|
1067
1241
|
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
createEmailPasswordSession(email, password) {
|
|
1242
|
+
createEmailPasswordSession(paramsOrFirst, ...rest) {
|
|
1243
|
+
let params;
|
|
1244
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1245
|
+
params = (paramsOrFirst || {});
|
|
1246
|
+
}
|
|
1247
|
+
else {
|
|
1248
|
+
params = {
|
|
1249
|
+
email: paramsOrFirst,
|
|
1250
|
+
password: rest[0]
|
|
1251
|
+
};
|
|
1252
|
+
}
|
|
1253
|
+
const email = params.email;
|
|
1254
|
+
const password = params.password;
|
|
1082
1255
|
if (typeof email === 'undefined') {
|
|
1083
1256
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
1084
1257
|
}
|
|
@@ -1098,17 +1271,19 @@ class Account extends Service {
|
|
|
1098
1271
|
'content-type': 'application/json',
|
|
1099
1272
|
}, payload);
|
|
1100
1273
|
}
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1274
|
+
updateMagicURLSession(paramsOrFirst, ...rest) {
|
|
1275
|
+
let params;
|
|
1276
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1277
|
+
params = (paramsOrFirst || {});
|
|
1278
|
+
}
|
|
1279
|
+
else {
|
|
1280
|
+
params = {
|
|
1281
|
+
userId: paramsOrFirst,
|
|
1282
|
+
secret: rest[0]
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
const userId = params.userId;
|
|
1286
|
+
const secret = params.secret;
|
|
1112
1287
|
if (typeof userId === 'undefined') {
|
|
1113
1288
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1114
1289
|
}
|
|
@@ -1128,32 +1303,23 @@ class Account extends Service {
|
|
|
1128
1303
|
'content-type': 'application/json',
|
|
1129
1304
|
}, payload);
|
|
1130
1305
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
*
|
|
1149
|
-
* @param {OAuthProvider} provider
|
|
1150
|
-
* @param {string} success
|
|
1151
|
-
* @param {string} failure
|
|
1152
|
-
* @param {string[]} scopes
|
|
1153
|
-
* @throws {AppwriteException}
|
|
1154
|
-
* @returns {void|string}
|
|
1155
|
-
*/
|
|
1156
|
-
createOAuth2Session(provider, success, failure, scopes) {
|
|
1306
|
+
createOAuth2Session(paramsOrFirst, ...rest) {
|
|
1307
|
+
let params;
|
|
1308
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
1309
|
+
params = (paramsOrFirst || {});
|
|
1310
|
+
}
|
|
1311
|
+
else {
|
|
1312
|
+
params = {
|
|
1313
|
+
provider: paramsOrFirst,
|
|
1314
|
+
success: rest[0],
|
|
1315
|
+
failure: rest[1],
|
|
1316
|
+
scopes: rest[2]
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
const provider = params.provider;
|
|
1320
|
+
const success = params.success;
|
|
1321
|
+
const failure = params.failure;
|
|
1322
|
+
const scopes = params.scopes;
|
|
1157
1323
|
if (typeof provider === 'undefined') {
|
|
1158
1324
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
1159
1325
|
}
|
|
@@ -1175,17 +1341,19 @@ class Account extends Service {
|
|
|
1175
1341
|
}
|
|
1176
1342
|
return uri;
|
|
1177
1343
|
}
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1344
|
+
updatePhoneSession(paramsOrFirst, ...rest) {
|
|
1345
|
+
let params;
|
|
1346
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1347
|
+
params = (paramsOrFirst || {});
|
|
1348
|
+
}
|
|
1349
|
+
else {
|
|
1350
|
+
params = {
|
|
1351
|
+
userId: paramsOrFirst,
|
|
1352
|
+
secret: rest[0]
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
const userId = params.userId;
|
|
1356
|
+
const secret = params.secret;
|
|
1189
1357
|
if (typeof userId === 'undefined') {
|
|
1190
1358
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1191
1359
|
}
|
|
@@ -1205,17 +1373,19 @@ class Account extends Service {
|
|
|
1205
1373
|
'content-type': 'application/json',
|
|
1206
1374
|
}, payload);
|
|
1207
1375
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1376
|
+
createSession(paramsOrFirst, ...rest) {
|
|
1377
|
+
let params;
|
|
1378
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1379
|
+
params = (paramsOrFirst || {});
|
|
1380
|
+
}
|
|
1381
|
+
else {
|
|
1382
|
+
params = {
|
|
1383
|
+
userId: paramsOrFirst,
|
|
1384
|
+
secret: rest[0]
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
const userId = params.userId;
|
|
1388
|
+
const secret = params.secret;
|
|
1219
1389
|
if (typeof userId === 'undefined') {
|
|
1220
1390
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1221
1391
|
}
|
|
@@ -1235,15 +1405,17 @@ class Account extends Service {
|
|
|
1235
1405
|
'content-type': 'application/json',
|
|
1236
1406
|
}, payload);
|
|
1237
1407
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1408
|
+
getSession(paramsOrFirst) {
|
|
1409
|
+
let params;
|
|
1410
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1411
|
+
params = (paramsOrFirst || {});
|
|
1412
|
+
}
|
|
1413
|
+
else {
|
|
1414
|
+
params = {
|
|
1415
|
+
sessionId: paramsOrFirst
|
|
1416
|
+
};
|
|
1417
|
+
}
|
|
1418
|
+
const sessionId = params.sessionId;
|
|
1247
1419
|
if (typeof sessionId === 'undefined') {
|
|
1248
1420
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1249
1421
|
}
|
|
@@ -1252,16 +1424,17 @@ class Account extends Service {
|
|
|
1252
1424
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1253
1425
|
return this.client.call('get', uri, {}, payload);
|
|
1254
1426
|
}
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1427
|
+
updateSession(paramsOrFirst) {
|
|
1428
|
+
let params;
|
|
1429
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1430
|
+
params = (paramsOrFirst || {});
|
|
1431
|
+
}
|
|
1432
|
+
else {
|
|
1433
|
+
params = {
|
|
1434
|
+
sessionId: paramsOrFirst
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
const sessionId = params.sessionId;
|
|
1265
1438
|
if (typeof sessionId === 'undefined') {
|
|
1266
1439
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1267
1440
|
}
|
|
@@ -1272,18 +1445,17 @@ class Account extends Service {
|
|
|
1272
1445
|
'content-type': 'application/json',
|
|
1273
1446
|
}, payload);
|
|
1274
1447
|
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
deleteSession(sessionId) {
|
|
1448
|
+
deleteSession(paramsOrFirst) {
|
|
1449
|
+
let params;
|
|
1450
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1451
|
+
params = (paramsOrFirst || {});
|
|
1452
|
+
}
|
|
1453
|
+
else {
|
|
1454
|
+
params = {
|
|
1455
|
+
sessionId: paramsOrFirst
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
const sessionId = params.sessionId;
|
|
1287
1459
|
if (typeof sessionId === 'undefined') {
|
|
1288
1460
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1289
1461
|
}
|
|
@@ -1295,9 +1467,7 @@ class Account extends Service {
|
|
|
1295
1467
|
}, payload);
|
|
1296
1468
|
}
|
|
1297
1469
|
/**
|
|
1298
|
-
* Block the currently logged in user account. Behind the scene, the user
|
|
1299
|
-
* record is not deleted but permanently blocked from any access. To
|
|
1300
|
-
* completely delete a user, use the Users API instead.
|
|
1470
|
+
* Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
|
|
1301
1471
|
*
|
|
1302
1472
|
* @throws {AppwriteException}
|
|
1303
1473
|
* @returns {Promise}
|
|
@@ -1310,20 +1480,21 @@ class Account extends Service {
|
|
|
1310
1480
|
'content-type': 'application/json',
|
|
1311
1481
|
}, payload);
|
|
1312
1482
|
}
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1483
|
+
createPushTarget(paramsOrFirst, ...rest) {
|
|
1484
|
+
let params;
|
|
1485
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1486
|
+
params = (paramsOrFirst || {});
|
|
1487
|
+
}
|
|
1488
|
+
else {
|
|
1489
|
+
params = {
|
|
1490
|
+
targetId: paramsOrFirst,
|
|
1491
|
+
identifier: rest[0],
|
|
1492
|
+
providerId: rest[1]
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
const targetId = params.targetId;
|
|
1496
|
+
const identifier = params.identifier;
|
|
1497
|
+
const providerId = params.providerId;
|
|
1327
1498
|
if (typeof targetId === 'undefined') {
|
|
1328
1499
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1329
1500
|
}
|
|
@@ -1346,19 +1517,19 @@ class Account extends Service {
|
|
|
1346
1517
|
'content-type': 'application/json',
|
|
1347
1518
|
}, payload);
|
|
1348
1519
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1520
|
+
updatePushTarget(paramsOrFirst, ...rest) {
|
|
1521
|
+
let params;
|
|
1522
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1523
|
+
params = (paramsOrFirst || {});
|
|
1524
|
+
}
|
|
1525
|
+
else {
|
|
1526
|
+
params = {
|
|
1527
|
+
targetId: paramsOrFirst,
|
|
1528
|
+
identifier: rest[0]
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
const targetId = params.targetId;
|
|
1532
|
+
const identifier = params.identifier;
|
|
1362
1533
|
if (typeof targetId === 'undefined') {
|
|
1363
1534
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1364
1535
|
}
|
|
@@ -1375,16 +1546,17 @@ class Account extends Service {
|
|
|
1375
1546
|
'content-type': 'application/json',
|
|
1376
1547
|
}, payload);
|
|
1377
1548
|
}
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1549
|
+
deletePushTarget(paramsOrFirst) {
|
|
1550
|
+
let params;
|
|
1551
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1552
|
+
params = (paramsOrFirst || {});
|
|
1553
|
+
}
|
|
1554
|
+
else {
|
|
1555
|
+
params = {
|
|
1556
|
+
targetId: paramsOrFirst
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
const targetId = params.targetId;
|
|
1388
1560
|
if (typeof targetId === 'undefined') {
|
|
1389
1561
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1390
1562
|
}
|
|
@@ -1395,25 +1567,21 @@ class Account extends Service {
|
|
|
1395
1567
|
'content-type': 'application/json',
|
|
1396
1568
|
}, payload);
|
|
1397
1569
|
}
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
* @throws {AppwriteException}
|
|
1414
|
-
* @returns {Promise}
|
|
1415
|
-
*/
|
|
1416
|
-
createEmailToken(userId, email, phrase) {
|
|
1570
|
+
createEmailToken(paramsOrFirst, ...rest) {
|
|
1571
|
+
let params;
|
|
1572
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1573
|
+
params = (paramsOrFirst || {});
|
|
1574
|
+
}
|
|
1575
|
+
else {
|
|
1576
|
+
params = {
|
|
1577
|
+
userId: paramsOrFirst,
|
|
1578
|
+
email: rest[0],
|
|
1579
|
+
phrase: rest[1]
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
const userId = params.userId;
|
|
1583
|
+
const email = params.email;
|
|
1584
|
+
const phrase = params.phrase;
|
|
1417
1585
|
if (typeof userId === 'undefined') {
|
|
1418
1586
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1419
1587
|
}
|
|
@@ -1436,30 +1604,23 @@ class Account extends Service {
|
|
|
1436
1604
|
'content-type': 'application/json',
|
|
1437
1605
|
}, payload);
|
|
1438
1606
|
}
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
* @param {string} email
|
|
1457
|
-
* @param {string} url
|
|
1458
|
-
* @param {boolean} phrase
|
|
1459
|
-
* @throws {AppwriteException}
|
|
1460
|
-
* @returns {Promise}
|
|
1461
|
-
*/
|
|
1462
|
-
createMagicURLToken(userId, email, url, phrase) {
|
|
1607
|
+
createMagicURLToken(paramsOrFirst, ...rest) {
|
|
1608
|
+
let params;
|
|
1609
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1610
|
+
params = (paramsOrFirst || {});
|
|
1611
|
+
}
|
|
1612
|
+
else {
|
|
1613
|
+
params = {
|
|
1614
|
+
userId: paramsOrFirst,
|
|
1615
|
+
email: rest[0],
|
|
1616
|
+
url: rest[1],
|
|
1617
|
+
phrase: rest[2]
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
const userId = params.userId;
|
|
1621
|
+
const email = params.email;
|
|
1622
|
+
const url = params.url;
|
|
1623
|
+
const phrase = params.phrase;
|
|
1463
1624
|
if (typeof userId === 'undefined') {
|
|
1464
1625
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1465
1626
|
}
|
|
@@ -1485,30 +1646,23 @@ class Account extends Service {
|
|
|
1485
1646
|
'content-type': 'application/json',
|
|
1486
1647
|
}, payload);
|
|
1487
1648
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
* @param {string} success
|
|
1506
|
-
* @param {string} failure
|
|
1507
|
-
* @param {string[]} scopes
|
|
1508
|
-
* @throws {AppwriteException}
|
|
1509
|
-
* @returns {void|string}
|
|
1510
|
-
*/
|
|
1511
|
-
createOAuth2Token(provider, success, failure, scopes) {
|
|
1649
|
+
createOAuth2Token(paramsOrFirst, ...rest) {
|
|
1650
|
+
let params;
|
|
1651
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
1652
|
+
params = (paramsOrFirst || {});
|
|
1653
|
+
}
|
|
1654
|
+
else {
|
|
1655
|
+
params = {
|
|
1656
|
+
provider: paramsOrFirst,
|
|
1657
|
+
success: rest[0],
|
|
1658
|
+
failure: rest[1],
|
|
1659
|
+
scopes: rest[2]
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
const provider = params.provider;
|
|
1663
|
+
const success = params.success;
|
|
1664
|
+
const failure = params.failure;
|
|
1665
|
+
const scopes = params.scopes;
|
|
1512
1666
|
if (typeof provider === 'undefined') {
|
|
1513
1667
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
1514
1668
|
}
|
|
@@ -1530,24 +1684,19 @@ class Account extends Service {
|
|
|
1530
1684
|
}
|
|
1531
1685
|
return uri;
|
|
1532
1686
|
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
* @param {string} phone
|
|
1547
|
-
* @throws {AppwriteException}
|
|
1548
|
-
* @returns {Promise}
|
|
1549
|
-
*/
|
|
1550
|
-
createPhoneToken(userId, phone) {
|
|
1687
|
+
createPhoneToken(paramsOrFirst, ...rest) {
|
|
1688
|
+
let params;
|
|
1689
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1690
|
+
params = (paramsOrFirst || {});
|
|
1691
|
+
}
|
|
1692
|
+
else {
|
|
1693
|
+
params = {
|
|
1694
|
+
userId: paramsOrFirst,
|
|
1695
|
+
phone: rest[0]
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1698
|
+
const userId = params.userId;
|
|
1699
|
+
const phone = params.phone;
|
|
1551
1700
|
if (typeof userId === 'undefined') {
|
|
1552
1701
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1553
1702
|
}
|
|
@@ -1567,28 +1716,17 @@ class Account extends Service {
|
|
|
1567
1716
|
'content-type': 'application/json',
|
|
1568
1717
|
}, payload);
|
|
1569
1718
|
}
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
* Please note that in order to avoid a [Redirect
|
|
1582
|
-
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
|
|
1583
|
-
* the only valid redirect URLs are the ones from domains you have set when
|
|
1584
|
-
* adding your platforms in the console interface.
|
|
1585
|
-
*
|
|
1586
|
-
*
|
|
1587
|
-
* @param {string} url
|
|
1588
|
-
* @throws {AppwriteException}
|
|
1589
|
-
* @returns {Promise}
|
|
1590
|
-
*/
|
|
1591
|
-
createVerification(url) {
|
|
1719
|
+
createVerification(paramsOrFirst) {
|
|
1720
|
+
let params;
|
|
1721
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1722
|
+
params = (paramsOrFirst || {});
|
|
1723
|
+
}
|
|
1724
|
+
else {
|
|
1725
|
+
params = {
|
|
1726
|
+
url: paramsOrFirst
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
const url = params.url;
|
|
1592
1730
|
if (typeof url === 'undefined') {
|
|
1593
1731
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
1594
1732
|
}
|
|
@@ -1602,18 +1740,19 @@ class Account extends Service {
|
|
|
1602
1740
|
'content-type': 'application/json',
|
|
1603
1741
|
}, payload);
|
|
1604
1742
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1743
|
+
updateVerification(paramsOrFirst, ...rest) {
|
|
1744
|
+
let params;
|
|
1745
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1746
|
+
params = (paramsOrFirst || {});
|
|
1747
|
+
}
|
|
1748
|
+
else {
|
|
1749
|
+
params = {
|
|
1750
|
+
userId: paramsOrFirst,
|
|
1751
|
+
secret: rest[0]
|
|
1752
|
+
};
|
|
1753
|
+
}
|
|
1754
|
+
const userId = params.userId;
|
|
1755
|
+
const secret = params.secret;
|
|
1617
1756
|
if (typeof userId === 'undefined') {
|
|
1618
1757
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1619
1758
|
}
|
|
@@ -1634,14 +1773,7 @@ class Account extends Service {
|
|
|
1634
1773
|
}, payload);
|
|
1635
1774
|
}
|
|
1636
1775
|
/**
|
|
1637
|
-
* Use this endpoint to send a verification SMS to the currently logged in
|
|
1638
|
-
* user. This endpoint is meant for use after updating a user's phone number
|
|
1639
|
-
* using the
|
|
1640
|
-
* [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone)
|
|
1641
|
-
* endpoint. Learn more about how to [complete the verification
|
|
1642
|
-
* process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification).
|
|
1643
|
-
* The verification code sent to the user's phone number is valid for 15
|
|
1644
|
-
* minutes.
|
|
1776
|
+
* Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.
|
|
1645
1777
|
*
|
|
1646
1778
|
* @throws {AppwriteException}
|
|
1647
1779
|
* @returns {Promise}
|
|
@@ -1654,18 +1786,19 @@ class Account extends Service {
|
|
|
1654
1786
|
'content-type': 'application/json',
|
|
1655
1787
|
}, payload);
|
|
1656
1788
|
}
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1789
|
+
updatePhoneVerification(paramsOrFirst, ...rest) {
|
|
1790
|
+
let params;
|
|
1791
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1792
|
+
params = (paramsOrFirst || {});
|
|
1793
|
+
}
|
|
1794
|
+
else {
|
|
1795
|
+
params = {
|
|
1796
|
+
userId: paramsOrFirst,
|
|
1797
|
+
secret: rest[0]
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
const userId = params.userId;
|
|
1801
|
+
const secret = params.secret;
|
|
1669
1802
|
if (typeof userId === 'undefined') {
|
|
1670
1803
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1671
1804
|
}
|
|
@@ -1691,26 +1824,23 @@ class Avatars extends Service {
|
|
|
1691
1824
|
constructor(client) {
|
|
1692
1825
|
super(client);
|
|
1693
1826
|
}
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
* @returns {ArrayBuffer}
|
|
1712
|
-
*/
|
|
1713
|
-
getBrowser(code, width, height, quality) {
|
|
1827
|
+
getBrowser(paramsOrFirst, ...rest) {
|
|
1828
|
+
let params;
|
|
1829
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
1830
|
+
params = (paramsOrFirst || {});
|
|
1831
|
+
}
|
|
1832
|
+
else {
|
|
1833
|
+
params = {
|
|
1834
|
+
code: paramsOrFirst,
|
|
1835
|
+
width: rest[0],
|
|
1836
|
+
height: rest[1],
|
|
1837
|
+
quality: rest[2]
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
const code = params.code;
|
|
1841
|
+
const width = params.width;
|
|
1842
|
+
const height = params.height;
|
|
1843
|
+
const quality = params.quality;
|
|
1714
1844
|
if (typeof code === 'undefined') {
|
|
1715
1845
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
1716
1846
|
}
|
|
@@ -1732,25 +1862,23 @@ class Avatars extends Service {
|
|
|
1732
1862
|
}
|
|
1733
1863
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1734
1864
|
}
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
*/
|
|
1753
|
-
getCreditCard(code, width, height, quality) {
|
|
1865
|
+
getCreditCard(paramsOrFirst, ...rest) {
|
|
1866
|
+
let params;
|
|
1867
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
1868
|
+
params = (paramsOrFirst || {});
|
|
1869
|
+
}
|
|
1870
|
+
else {
|
|
1871
|
+
params = {
|
|
1872
|
+
code: paramsOrFirst,
|
|
1873
|
+
width: rest[0],
|
|
1874
|
+
height: rest[1],
|
|
1875
|
+
quality: rest[2]
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
const code = params.code;
|
|
1879
|
+
const width = params.width;
|
|
1880
|
+
const height = params.height;
|
|
1881
|
+
const quality = params.quality;
|
|
1754
1882
|
if (typeof code === 'undefined') {
|
|
1755
1883
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
1756
1884
|
}
|
|
@@ -1772,17 +1900,17 @@ class Avatars extends Service {
|
|
|
1772
1900
|
}
|
|
1773
1901
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1774
1902
|
}
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1903
|
+
getFavicon(paramsOrFirst) {
|
|
1904
|
+
let params;
|
|
1905
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1906
|
+
params = (paramsOrFirst || {});
|
|
1907
|
+
}
|
|
1908
|
+
else {
|
|
1909
|
+
params = {
|
|
1910
|
+
url: paramsOrFirst
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
const url = params.url;
|
|
1786
1914
|
if (typeof url === 'undefined') {
|
|
1787
1915
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
1788
1916
|
}
|
|
@@ -1798,26 +1926,23 @@ class Avatars extends Service {
|
|
|
1798
1926
|
}
|
|
1799
1927
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1800
1928
|
}
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
* @returns {ArrayBuffer}
|
|
1819
|
-
*/
|
|
1820
|
-
getFlag(code, width, height, quality) {
|
|
1929
|
+
getFlag(paramsOrFirst, ...rest) {
|
|
1930
|
+
let params;
|
|
1931
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
1932
|
+
params = (paramsOrFirst || {});
|
|
1933
|
+
}
|
|
1934
|
+
else {
|
|
1935
|
+
params = {
|
|
1936
|
+
code: paramsOrFirst,
|
|
1937
|
+
width: rest[0],
|
|
1938
|
+
height: rest[1],
|
|
1939
|
+
quality: rest[2]
|
|
1940
|
+
};
|
|
1941
|
+
}
|
|
1942
|
+
const code = params.code;
|
|
1943
|
+
const width = params.width;
|
|
1944
|
+
const height = params.height;
|
|
1945
|
+
const quality = params.quality;
|
|
1821
1946
|
if (typeof code === 'undefined') {
|
|
1822
1947
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
1823
1948
|
}
|
|
@@ -1839,26 +1964,21 @@ class Avatars extends Service {
|
|
|
1839
1964
|
}
|
|
1840
1965
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1841
1966
|
}
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
* @param {number} height
|
|
1858
|
-
* @throws {AppwriteException}
|
|
1859
|
-
* @returns {ArrayBuffer}
|
|
1860
|
-
*/
|
|
1861
|
-
getImage(url, width, height) {
|
|
1967
|
+
getImage(paramsOrFirst, ...rest) {
|
|
1968
|
+
let params;
|
|
1969
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1970
|
+
params = (paramsOrFirst || {});
|
|
1971
|
+
}
|
|
1972
|
+
else {
|
|
1973
|
+
params = {
|
|
1974
|
+
url: paramsOrFirst,
|
|
1975
|
+
width: rest[0],
|
|
1976
|
+
height: rest[1]
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
const url = params.url;
|
|
1980
|
+
const width = params.width;
|
|
1981
|
+
const height = params.height;
|
|
1862
1982
|
if (typeof url === 'undefined') {
|
|
1863
1983
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
1864
1984
|
}
|
|
@@ -1880,32 +2000,23 @@ class Avatars extends Service {
|
|
|
1880
2000
|
}
|
|
1881
2001
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1882
2002
|
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
*
|
|
1901
|
-
* @param {string} name
|
|
1902
|
-
* @param {number} width
|
|
1903
|
-
* @param {number} height
|
|
1904
|
-
* @param {string} background
|
|
1905
|
-
* @throws {AppwriteException}
|
|
1906
|
-
* @returns {ArrayBuffer}
|
|
1907
|
-
*/
|
|
1908
|
-
getInitials(name, width, height, background) {
|
|
2003
|
+
getInitials(paramsOrFirst, ...rest) {
|
|
2004
|
+
let params;
|
|
2005
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2006
|
+
params = (paramsOrFirst || {});
|
|
2007
|
+
}
|
|
2008
|
+
else {
|
|
2009
|
+
params = {
|
|
2010
|
+
name: paramsOrFirst,
|
|
2011
|
+
width: rest[0],
|
|
2012
|
+
height: rest[1],
|
|
2013
|
+
background: rest[2]
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
const name = params.name;
|
|
2017
|
+
const width = params.width;
|
|
2018
|
+
const height = params.height;
|
|
2019
|
+
const background = params.background;
|
|
1909
2020
|
const apiPath = '/avatars/initials';
|
|
1910
2021
|
const payload = {};
|
|
1911
2022
|
if (typeof name !== 'undefined') {
|
|
@@ -1927,19 +2038,23 @@ class Avatars extends Service {
|
|
|
1927
2038
|
}
|
|
1928
2039
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1929
2040
|
}
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
2041
|
+
getQR(paramsOrFirst, ...rest) {
|
|
2042
|
+
let params;
|
|
2043
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2044
|
+
params = (paramsOrFirst || {});
|
|
2045
|
+
}
|
|
2046
|
+
else {
|
|
2047
|
+
params = {
|
|
2048
|
+
text: paramsOrFirst,
|
|
2049
|
+
size: rest[0],
|
|
2050
|
+
margin: rest[1],
|
|
2051
|
+
download: rest[2]
|
|
2052
|
+
};
|
|
2053
|
+
}
|
|
2054
|
+
const text = params.text;
|
|
2055
|
+
const size = params.size;
|
|
2056
|
+
const margin = params.margin;
|
|
2057
|
+
const download = params.download;
|
|
1943
2058
|
if (typeof text === 'undefined') {
|
|
1944
2059
|
throw new AppwriteException('Missing required parameter: "text"');
|
|
1945
2060
|
}
|
|
@@ -2225,17 +2340,21 @@ class Databases extends Service {
|
|
|
2225
2340
|
constructor(client) {
|
|
2226
2341
|
super(client);
|
|
2227
2342
|
}
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2343
|
+
listDocuments(paramsOrFirst, ...rest) {
|
|
2344
|
+
let params;
|
|
2345
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2346
|
+
params = (paramsOrFirst || {});
|
|
2347
|
+
}
|
|
2348
|
+
else {
|
|
2349
|
+
params = {
|
|
2350
|
+
databaseId: paramsOrFirst,
|
|
2351
|
+
collectionId: rest[0],
|
|
2352
|
+
queries: rest[1]
|
|
2353
|
+
};
|
|
2354
|
+
}
|
|
2355
|
+
const databaseId = params.databaseId;
|
|
2356
|
+
const collectionId = params.collectionId;
|
|
2357
|
+
const queries = params.queries;
|
|
2239
2358
|
if (typeof databaseId === 'undefined') {
|
|
2240
2359
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2241
2360
|
}
|
|
@@ -2250,21 +2369,25 @@ class Databases extends Service {
|
|
|
2250
2369
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2251
2370
|
return this.client.call('get', uri, {}, payload);
|
|
2252
2371
|
}
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2372
|
+
createDocument(paramsOrFirst, ...rest) {
|
|
2373
|
+
let params;
|
|
2374
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2375
|
+
params = (paramsOrFirst || {});
|
|
2376
|
+
}
|
|
2377
|
+
else {
|
|
2378
|
+
params = {
|
|
2379
|
+
databaseId: paramsOrFirst,
|
|
2380
|
+
collectionId: rest[0],
|
|
2381
|
+
documentId: rest[1],
|
|
2382
|
+
data: rest[2],
|
|
2383
|
+
permissions: rest[3]
|
|
2384
|
+
};
|
|
2385
|
+
}
|
|
2386
|
+
const databaseId = params.databaseId;
|
|
2387
|
+
const collectionId = params.collectionId;
|
|
2388
|
+
const documentId = params.documentId;
|
|
2389
|
+
const data = params.data;
|
|
2390
|
+
const permissions = params.permissions;
|
|
2268
2391
|
if (typeof databaseId === 'undefined') {
|
|
2269
2392
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2270
2393
|
}
|
|
@@ -2293,18 +2416,23 @@ class Databases extends Service {
|
|
|
2293
2416
|
'content-type': 'application/json',
|
|
2294
2417
|
}, payload);
|
|
2295
2418
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2419
|
+
getDocument(paramsOrFirst, ...rest) {
|
|
2420
|
+
let params;
|
|
2421
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2422
|
+
params = (paramsOrFirst || {});
|
|
2423
|
+
}
|
|
2424
|
+
else {
|
|
2425
|
+
params = {
|
|
2426
|
+
databaseId: paramsOrFirst,
|
|
2427
|
+
collectionId: rest[0],
|
|
2428
|
+
documentId: rest[1],
|
|
2429
|
+
queries: rest[2]
|
|
2430
|
+
};
|
|
2431
|
+
}
|
|
2432
|
+
const databaseId = params.databaseId;
|
|
2433
|
+
const collectionId = params.collectionId;
|
|
2434
|
+
const documentId = params.documentId;
|
|
2435
|
+
const queries = params.queries;
|
|
2308
2436
|
if (typeof databaseId === 'undefined') {
|
|
2309
2437
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2310
2438
|
}
|
|
@@ -2322,25 +2450,25 @@ class Databases extends Service {
|
|
|
2322
2450
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2323
2451
|
return this.client.call('get', uri, {}, payload);
|
|
2324
2452
|
}
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2453
|
+
upsertDocument(paramsOrFirst, ...rest) {
|
|
2454
|
+
let params;
|
|
2455
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2456
|
+
params = (paramsOrFirst || {});
|
|
2457
|
+
}
|
|
2458
|
+
else {
|
|
2459
|
+
params = {
|
|
2460
|
+
databaseId: paramsOrFirst,
|
|
2461
|
+
collectionId: rest[0],
|
|
2462
|
+
documentId: rest[1],
|
|
2463
|
+
data: rest[2],
|
|
2464
|
+
permissions: rest[3]
|
|
2465
|
+
};
|
|
2466
|
+
}
|
|
2467
|
+
const databaseId = params.databaseId;
|
|
2468
|
+
const collectionId = params.collectionId;
|
|
2469
|
+
const documentId = params.documentId;
|
|
2470
|
+
const data = params.data;
|
|
2471
|
+
const permissions = params.permissions;
|
|
2344
2472
|
if (typeof databaseId === 'undefined') {
|
|
2345
2473
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2346
2474
|
}
|
|
@@ -2366,19 +2494,25 @@ class Databases extends Service {
|
|
|
2366
2494
|
'content-type': 'application/json',
|
|
2367
2495
|
}, payload);
|
|
2368
2496
|
}
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2497
|
+
updateDocument(paramsOrFirst, ...rest) {
|
|
2498
|
+
let params;
|
|
2499
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2500
|
+
params = (paramsOrFirst || {});
|
|
2501
|
+
}
|
|
2502
|
+
else {
|
|
2503
|
+
params = {
|
|
2504
|
+
databaseId: paramsOrFirst,
|
|
2505
|
+
collectionId: rest[0],
|
|
2506
|
+
documentId: rest[1],
|
|
2507
|
+
data: rest[2],
|
|
2508
|
+
permissions: rest[3]
|
|
2509
|
+
};
|
|
2510
|
+
}
|
|
2511
|
+
const databaseId = params.databaseId;
|
|
2512
|
+
const collectionId = params.collectionId;
|
|
2513
|
+
const documentId = params.documentId;
|
|
2514
|
+
const data = params.data;
|
|
2515
|
+
const permissions = params.permissions;
|
|
2382
2516
|
if (typeof databaseId === 'undefined') {
|
|
2383
2517
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2384
2518
|
}
|
|
@@ -2401,16 +2535,21 @@ class Databases extends Service {
|
|
|
2401
2535
|
'content-type': 'application/json',
|
|
2402
2536
|
}, payload);
|
|
2403
2537
|
}
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2538
|
+
deleteDocument(paramsOrFirst, ...rest) {
|
|
2539
|
+
let params;
|
|
2540
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2541
|
+
params = (paramsOrFirst || {});
|
|
2542
|
+
}
|
|
2543
|
+
else {
|
|
2544
|
+
params = {
|
|
2545
|
+
databaseId: paramsOrFirst,
|
|
2546
|
+
collectionId: rest[0],
|
|
2547
|
+
documentId: rest[1]
|
|
2548
|
+
};
|
|
2549
|
+
}
|
|
2550
|
+
const databaseId = params.databaseId;
|
|
2551
|
+
const collectionId = params.collectionId;
|
|
2552
|
+
const documentId = params.documentId;
|
|
2414
2553
|
if (typeof databaseId === 'undefined') {
|
|
2415
2554
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2416
2555
|
}
|
|
@@ -2427,19 +2566,27 @@ class Databases extends Service {
|
|
|
2427
2566
|
'content-type': 'application/json',
|
|
2428
2567
|
}, payload);
|
|
2429
2568
|
}
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2569
|
+
decrementDocumentAttribute(paramsOrFirst, ...rest) {
|
|
2570
|
+
let params;
|
|
2571
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2572
|
+
params = (paramsOrFirst || {});
|
|
2573
|
+
}
|
|
2574
|
+
else {
|
|
2575
|
+
params = {
|
|
2576
|
+
databaseId: paramsOrFirst,
|
|
2577
|
+
collectionId: rest[0],
|
|
2578
|
+
documentId: rest[1],
|
|
2579
|
+
attribute: rest[2],
|
|
2580
|
+
value: rest[3],
|
|
2581
|
+
min: rest[4]
|
|
2582
|
+
};
|
|
2583
|
+
}
|
|
2584
|
+
const databaseId = params.databaseId;
|
|
2585
|
+
const collectionId = params.collectionId;
|
|
2586
|
+
const documentId = params.documentId;
|
|
2587
|
+
const attribute = params.attribute;
|
|
2588
|
+
const value = params.value;
|
|
2589
|
+
const min = params.min;
|
|
2443
2590
|
if (typeof databaseId === 'undefined') {
|
|
2444
2591
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2445
2592
|
}
|
|
@@ -2465,19 +2612,27 @@ class Databases extends Service {
|
|
|
2465
2612
|
'content-type': 'application/json',
|
|
2466
2613
|
}, payload);
|
|
2467
2614
|
}
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2615
|
+
incrementDocumentAttribute(paramsOrFirst, ...rest) {
|
|
2616
|
+
let params;
|
|
2617
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2618
|
+
params = (paramsOrFirst || {});
|
|
2619
|
+
}
|
|
2620
|
+
else {
|
|
2621
|
+
params = {
|
|
2622
|
+
databaseId: paramsOrFirst,
|
|
2623
|
+
collectionId: rest[0],
|
|
2624
|
+
documentId: rest[1],
|
|
2625
|
+
attribute: rest[2],
|
|
2626
|
+
value: rest[3],
|
|
2627
|
+
max: rest[4]
|
|
2628
|
+
};
|
|
2629
|
+
}
|
|
2630
|
+
const databaseId = params.databaseId;
|
|
2631
|
+
const collectionId = params.collectionId;
|
|
2632
|
+
const documentId = params.documentId;
|
|
2633
|
+
const attribute = params.attribute;
|
|
2634
|
+
const value = params.value;
|
|
2635
|
+
const max = params.max;
|
|
2481
2636
|
if (typeof databaseId === 'undefined') {
|
|
2482
2637
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2483
2638
|
}
|
|
@@ -2509,16 +2664,19 @@ class Functions extends Service {
|
|
|
2509
2664
|
constructor(client) {
|
|
2510
2665
|
super(client);
|
|
2511
2666
|
}
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2667
|
+
listExecutions(paramsOrFirst, ...rest) {
|
|
2668
|
+
let params;
|
|
2669
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2670
|
+
params = (paramsOrFirst || {});
|
|
2671
|
+
}
|
|
2672
|
+
else {
|
|
2673
|
+
params = {
|
|
2674
|
+
functionId: paramsOrFirst,
|
|
2675
|
+
queries: rest[0]
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
const functionId = params.functionId;
|
|
2679
|
+
const queries = params.queries;
|
|
2522
2680
|
if (typeof functionId === 'undefined') {
|
|
2523
2681
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
2524
2682
|
}
|
|
@@ -2530,23 +2688,29 @@ class Functions extends Service {
|
|
|
2530
2688
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2531
2689
|
return this.client.call('get', uri, {}, payload);
|
|
2532
2690
|
}
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2691
|
+
createExecution(paramsOrFirst, ...rest) {
|
|
2692
|
+
let params;
|
|
2693
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2694
|
+
params = (paramsOrFirst || {});
|
|
2695
|
+
}
|
|
2696
|
+
else {
|
|
2697
|
+
params = {
|
|
2698
|
+
functionId: paramsOrFirst,
|
|
2699
|
+
body: rest[0],
|
|
2700
|
+
async: rest[1],
|
|
2701
|
+
xpath: rest[2],
|
|
2702
|
+
method: rest[3],
|
|
2703
|
+
headers: rest[4],
|
|
2704
|
+
scheduledAt: rest[5]
|
|
2705
|
+
};
|
|
2706
|
+
}
|
|
2707
|
+
const functionId = params.functionId;
|
|
2708
|
+
const body = params.body;
|
|
2709
|
+
const async = params.async;
|
|
2710
|
+
const xpath = params.xpath;
|
|
2711
|
+
const method = params.method;
|
|
2712
|
+
const headers = params.headers;
|
|
2713
|
+
const scheduledAt = params.scheduledAt;
|
|
2550
2714
|
if (typeof functionId === 'undefined') {
|
|
2551
2715
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
2552
2716
|
}
|
|
@@ -2575,15 +2739,19 @@ class Functions extends Service {
|
|
|
2575
2739
|
'content-type': 'application/json',
|
|
2576
2740
|
}, payload);
|
|
2577
2741
|
}
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2742
|
+
getExecution(paramsOrFirst, ...rest) {
|
|
2743
|
+
let params;
|
|
2744
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2745
|
+
params = (paramsOrFirst || {});
|
|
2746
|
+
}
|
|
2747
|
+
else {
|
|
2748
|
+
params = {
|
|
2749
|
+
functionId: paramsOrFirst,
|
|
2750
|
+
executionId: rest[0]
|
|
2751
|
+
};
|
|
2752
|
+
}
|
|
2753
|
+
const functionId = params.functionId;
|
|
2754
|
+
const executionId = params.executionId;
|
|
2587
2755
|
if (typeof functionId === 'undefined') {
|
|
2588
2756
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
2589
2757
|
}
|
|
@@ -2601,14 +2769,17 @@ class Graphql extends Service {
|
|
|
2601
2769
|
constructor(client) {
|
|
2602
2770
|
super(client);
|
|
2603
2771
|
}
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2772
|
+
query(paramsOrFirst) {
|
|
2773
|
+
let params;
|
|
2774
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
2775
|
+
params = (paramsOrFirst || {});
|
|
2776
|
+
}
|
|
2777
|
+
else {
|
|
2778
|
+
params = {
|
|
2779
|
+
query: paramsOrFirst
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
const query = params.query;
|
|
2612
2783
|
if (typeof query === 'undefined') {
|
|
2613
2784
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
2614
2785
|
}
|
|
@@ -2623,14 +2794,17 @@ class Graphql extends Service {
|
|
|
2623
2794
|
'content-type': 'application/json',
|
|
2624
2795
|
}, payload);
|
|
2625
2796
|
}
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2797
|
+
mutation(paramsOrFirst) {
|
|
2798
|
+
let params;
|
|
2799
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
2800
|
+
params = (paramsOrFirst || {});
|
|
2801
|
+
}
|
|
2802
|
+
else {
|
|
2803
|
+
params = {
|
|
2804
|
+
query: paramsOrFirst
|
|
2805
|
+
};
|
|
2806
|
+
}
|
|
2807
|
+
const query = params.query;
|
|
2634
2808
|
if (typeof query === 'undefined') {
|
|
2635
2809
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
2636
2810
|
}
|
|
@@ -2652,10 +2826,7 @@ class Locale extends Service {
|
|
|
2652
2826
|
super(client);
|
|
2653
2827
|
}
|
|
2654
2828
|
/**
|
|
2655
|
-
* Get the current user location based on IP. Returns an object with user
|
|
2656
|
-
* country code, country name, continent name, continent code, ip address and
|
|
2657
|
-
* suggested currency. You can use the locale header to get the data in a
|
|
2658
|
-
* supported language.
|
|
2829
|
+
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
|
2659
2830
|
*
|
|
2660
2831
|
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
|
2661
2832
|
*
|
|
@@ -2669,8 +2840,7 @@ class Locale extends Service {
|
|
|
2669
2840
|
return this.client.call('get', uri, {}, payload);
|
|
2670
2841
|
}
|
|
2671
2842
|
/**
|
|
2672
|
-
* List of all locale codes in [ISO
|
|
2673
|
-
* 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
2843
|
+
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
2674
2844
|
*
|
|
2675
2845
|
* @throws {AppwriteException}
|
|
2676
2846
|
* @returns {Promise}
|
|
@@ -2682,8 +2852,7 @@ class Locale extends Service {
|
|
|
2682
2852
|
return this.client.call('get', uri, {}, payload);
|
|
2683
2853
|
}
|
|
2684
2854
|
/**
|
|
2685
|
-
* List of all continents. You can use the locale header to get the data in a
|
|
2686
|
-
* supported language.
|
|
2855
|
+
* List of all continents. You can use the locale header to get the data in a supported language.
|
|
2687
2856
|
*
|
|
2688
2857
|
* @throws {AppwriteException}
|
|
2689
2858
|
* @returns {Promise}
|
|
@@ -2695,8 +2864,7 @@ class Locale extends Service {
|
|
|
2695
2864
|
return this.client.call('get', uri, {}, payload);
|
|
2696
2865
|
}
|
|
2697
2866
|
/**
|
|
2698
|
-
* List of all countries. You can use the locale header to get the data in a
|
|
2699
|
-
* supported language.
|
|
2867
|
+
* List of all countries. You can use the locale header to get the data in a supported language.
|
|
2700
2868
|
*
|
|
2701
2869
|
* @throws {AppwriteException}
|
|
2702
2870
|
* @returns {Promise}
|
|
@@ -2708,8 +2876,7 @@ class Locale extends Service {
|
|
|
2708
2876
|
return this.client.call('get', uri, {}, payload);
|
|
2709
2877
|
}
|
|
2710
2878
|
/**
|
|
2711
|
-
* List of all countries that are currently members of the EU. You can use the
|
|
2712
|
-
* locale header to get the data in a supported language.
|
|
2879
|
+
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
|
2713
2880
|
*
|
|
2714
2881
|
* @throws {AppwriteException}
|
|
2715
2882
|
* @returns {Promise}
|
|
@@ -2721,8 +2888,7 @@ class Locale extends Service {
|
|
|
2721
2888
|
return this.client.call('get', uri, {}, payload);
|
|
2722
2889
|
}
|
|
2723
2890
|
/**
|
|
2724
|
-
* List of all countries phone codes. You can use the locale header to get the
|
|
2725
|
-
* data in a supported language.
|
|
2891
|
+
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
|
2726
2892
|
*
|
|
2727
2893
|
* @throws {AppwriteException}
|
|
2728
2894
|
* @returns {Promise}
|
|
@@ -2734,9 +2900,7 @@ class Locale extends Service {
|
|
|
2734
2900
|
return this.client.call('get', uri, {}, payload);
|
|
2735
2901
|
}
|
|
2736
2902
|
/**
|
|
2737
|
-
* List of all currencies, including currency symbol, name, plural, and
|
|
2738
|
-
* decimal digits for all major and minor currencies. You can use the locale
|
|
2739
|
-
* header to get the data in a supported language.
|
|
2903
|
+
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
|
2740
2904
|
*
|
|
2741
2905
|
* @throws {AppwriteException}
|
|
2742
2906
|
* @returns {Promise}
|
|
@@ -2748,8 +2912,7 @@ class Locale extends Service {
|
|
|
2748
2912
|
return this.client.call('get', uri, {}, payload);
|
|
2749
2913
|
}
|
|
2750
2914
|
/**
|
|
2751
|
-
* List of all languages classified by ISO 639-1 including 2-letter code, name
|
|
2752
|
-
* in English, and name in the respective language.
|
|
2915
|
+
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
|
2753
2916
|
*
|
|
2754
2917
|
* @throws {AppwriteException}
|
|
2755
2918
|
* @returns {Promise}
|
|
@@ -2766,16 +2929,21 @@ class Messaging extends Service {
|
|
|
2766
2929
|
constructor(client) {
|
|
2767
2930
|
super(client);
|
|
2768
2931
|
}
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2932
|
+
createSubscriber(paramsOrFirst, ...rest) {
|
|
2933
|
+
let params;
|
|
2934
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2935
|
+
params = (paramsOrFirst || {});
|
|
2936
|
+
}
|
|
2937
|
+
else {
|
|
2938
|
+
params = {
|
|
2939
|
+
topicId: paramsOrFirst,
|
|
2940
|
+
subscriberId: rest[0],
|
|
2941
|
+
targetId: rest[1]
|
|
2942
|
+
};
|
|
2943
|
+
}
|
|
2944
|
+
const topicId = params.topicId;
|
|
2945
|
+
const subscriberId = params.subscriberId;
|
|
2946
|
+
const targetId = params.targetId;
|
|
2779
2947
|
if (typeof topicId === 'undefined') {
|
|
2780
2948
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2781
2949
|
}
|
|
@@ -2798,15 +2966,19 @@ class Messaging extends Service {
|
|
|
2798
2966
|
'content-type': 'application/json',
|
|
2799
2967
|
}, payload);
|
|
2800
2968
|
}
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2969
|
+
deleteSubscriber(paramsOrFirst, ...rest) {
|
|
2970
|
+
let params;
|
|
2971
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2972
|
+
params = (paramsOrFirst || {});
|
|
2973
|
+
}
|
|
2974
|
+
else {
|
|
2975
|
+
params = {
|
|
2976
|
+
topicId: paramsOrFirst,
|
|
2977
|
+
subscriberId: rest[0]
|
|
2978
|
+
};
|
|
2979
|
+
}
|
|
2980
|
+
const topicId = params.topicId;
|
|
2981
|
+
const subscriberId = params.subscriberId;
|
|
2810
2982
|
if (typeof topicId === 'undefined') {
|
|
2811
2983
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2812
2984
|
}
|
|
@@ -2826,17 +2998,21 @@ class Storage extends Service {
|
|
|
2826
2998
|
constructor(client) {
|
|
2827
2999
|
super(client);
|
|
2828
3000
|
}
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
3001
|
+
listFiles(paramsOrFirst, ...rest) {
|
|
3002
|
+
let params;
|
|
3003
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3004
|
+
params = (paramsOrFirst || {});
|
|
3005
|
+
}
|
|
3006
|
+
else {
|
|
3007
|
+
params = {
|
|
3008
|
+
bucketId: paramsOrFirst,
|
|
3009
|
+
queries: rest[0],
|
|
3010
|
+
search: rest[1]
|
|
3011
|
+
};
|
|
3012
|
+
}
|
|
3013
|
+
const bucketId = params.bucketId;
|
|
3014
|
+
const queries = params.queries;
|
|
3015
|
+
const search = params.search;
|
|
2840
3016
|
if (typeof bucketId === 'undefined') {
|
|
2841
3017
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2842
3018
|
}
|
|
@@ -2851,35 +3027,27 @@ class Storage extends Service {
|
|
|
2851
3027
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2852
3028
|
return this.client.call('get', uri, {}, payload);
|
|
2853
3029
|
}
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
* @param {string} fileId
|
|
2876
|
-
* @param {{name: string, type: string, size: number, uri: string}} file
|
|
2877
|
-
* @param {string[]} permissions
|
|
2878
|
-
* @throws {AppwriteException}
|
|
2879
|
-
* @returns {Promise}
|
|
2880
|
-
*/
|
|
2881
|
-
createFile(bucketId_1, fileId_1, file_1, permissions_1) {
|
|
2882
|
-
return __awaiter(this, arguments, void 0, function* (bucketId, fileId, file, permissions, onProgress = (progress) => { }) {
|
|
3030
|
+
createFile(paramsOrFirst, ...rest) {
|
|
3031
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3032
|
+
let params;
|
|
3033
|
+
let onProgress;
|
|
3034
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3035
|
+
params = (paramsOrFirst || {});
|
|
3036
|
+
onProgress = paramsOrFirst === null || paramsOrFirst === void 0 ? void 0 : paramsOrFirst.onProgress;
|
|
3037
|
+
}
|
|
3038
|
+
else {
|
|
3039
|
+
params = {
|
|
3040
|
+
bucketId: paramsOrFirst,
|
|
3041
|
+
fileId: rest[0],
|
|
3042
|
+
file: rest[1],
|
|
3043
|
+
permissions: rest[2]
|
|
3044
|
+
};
|
|
3045
|
+
onProgress = rest[3];
|
|
3046
|
+
}
|
|
3047
|
+
const bucketId = params.bucketId;
|
|
3048
|
+
const fileId = params.fileId;
|
|
3049
|
+
const file = params.file;
|
|
3050
|
+
const permissions = params.permissions;
|
|
2883
3051
|
if (typeof bucketId === 'undefined') {
|
|
2884
3052
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2885
3053
|
}
|
|
@@ -2951,16 +3119,19 @@ class Storage extends Service {
|
|
|
2951
3119
|
return response;
|
|
2952
3120
|
});
|
|
2953
3121
|
}
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
3122
|
+
getFile(paramsOrFirst, ...rest) {
|
|
3123
|
+
let params;
|
|
3124
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3125
|
+
params = (paramsOrFirst || {});
|
|
3126
|
+
}
|
|
3127
|
+
else {
|
|
3128
|
+
params = {
|
|
3129
|
+
bucketId: paramsOrFirst,
|
|
3130
|
+
fileId: rest[0]
|
|
3131
|
+
};
|
|
3132
|
+
}
|
|
3133
|
+
const bucketId = params.bucketId;
|
|
3134
|
+
const fileId = params.fileId;
|
|
2964
3135
|
if (typeof bucketId === 'undefined') {
|
|
2965
3136
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2966
3137
|
}
|
|
@@ -2972,18 +3143,23 @@ class Storage extends Service {
|
|
|
2972
3143
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2973
3144
|
return this.client.call('get', uri, {}, payload);
|
|
2974
3145
|
}
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
3146
|
+
updateFile(paramsOrFirst, ...rest) {
|
|
3147
|
+
let params;
|
|
3148
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3149
|
+
params = (paramsOrFirst || {});
|
|
3150
|
+
}
|
|
3151
|
+
else {
|
|
3152
|
+
params = {
|
|
3153
|
+
bucketId: paramsOrFirst,
|
|
3154
|
+
fileId: rest[0],
|
|
3155
|
+
name: rest[1],
|
|
3156
|
+
permissions: rest[2]
|
|
3157
|
+
};
|
|
3158
|
+
}
|
|
3159
|
+
const bucketId = params.bucketId;
|
|
3160
|
+
const fileId = params.fileId;
|
|
3161
|
+
const name = params.name;
|
|
3162
|
+
const permissions = params.permissions;
|
|
2987
3163
|
if (typeof bucketId === 'undefined') {
|
|
2988
3164
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2989
3165
|
}
|
|
@@ -3003,16 +3179,19 @@ class Storage extends Service {
|
|
|
3003
3179
|
'content-type': 'application/json',
|
|
3004
3180
|
}, payload);
|
|
3005
3181
|
}
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3182
|
+
deleteFile(paramsOrFirst, ...rest) {
|
|
3183
|
+
let params;
|
|
3184
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3185
|
+
params = (paramsOrFirst || {});
|
|
3186
|
+
}
|
|
3187
|
+
else {
|
|
3188
|
+
params = {
|
|
3189
|
+
bucketId: paramsOrFirst,
|
|
3190
|
+
fileId: rest[0]
|
|
3191
|
+
};
|
|
3192
|
+
}
|
|
3193
|
+
const bucketId = params.bucketId;
|
|
3194
|
+
const fileId = params.fileId;
|
|
3016
3195
|
if (typeof bucketId === 'undefined') {
|
|
3017
3196
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3018
3197
|
}
|
|
@@ -3026,18 +3205,21 @@ class Storage extends Service {
|
|
|
3026
3205
|
'content-type': 'application/json',
|
|
3027
3206
|
}, payload);
|
|
3028
3207
|
}
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3208
|
+
getFileDownload(paramsOrFirst, ...rest) {
|
|
3209
|
+
let params;
|
|
3210
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3211
|
+
params = (paramsOrFirst || {});
|
|
3212
|
+
}
|
|
3213
|
+
else {
|
|
3214
|
+
params = {
|
|
3215
|
+
bucketId: paramsOrFirst,
|
|
3216
|
+
fileId: rest[0],
|
|
3217
|
+
token: rest[1]
|
|
3218
|
+
};
|
|
3219
|
+
}
|
|
3220
|
+
const bucketId = params.bucketId;
|
|
3221
|
+
const fileId = params.fileId;
|
|
3222
|
+
const token = params.token;
|
|
3041
3223
|
if (typeof bucketId === 'undefined') {
|
|
3042
3224
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3043
3225
|
}
|
|
@@ -3056,31 +3238,43 @@ class Storage extends Service {
|
|
|
3056
3238
|
}
|
|
3057
3239
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
3058
3240
|
}
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3241
|
+
getFilePreview(paramsOrFirst, ...rest) {
|
|
3242
|
+
let params;
|
|
3243
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3244
|
+
params = (paramsOrFirst || {});
|
|
3245
|
+
}
|
|
3246
|
+
else {
|
|
3247
|
+
params = {
|
|
3248
|
+
bucketId: paramsOrFirst,
|
|
3249
|
+
fileId: rest[0],
|
|
3250
|
+
width: rest[1],
|
|
3251
|
+
height: rest[2],
|
|
3252
|
+
gravity: rest[3],
|
|
3253
|
+
quality: rest[4],
|
|
3254
|
+
borderWidth: rest[5],
|
|
3255
|
+
borderColor: rest[6],
|
|
3256
|
+
borderRadius: rest[7],
|
|
3257
|
+
opacity: rest[8],
|
|
3258
|
+
rotation: rest[9],
|
|
3259
|
+
background: rest[10],
|
|
3260
|
+
output: rest[11],
|
|
3261
|
+
token: rest[12]
|
|
3262
|
+
};
|
|
3263
|
+
}
|
|
3264
|
+
const bucketId = params.bucketId;
|
|
3265
|
+
const fileId = params.fileId;
|
|
3266
|
+
const width = params.width;
|
|
3267
|
+
const height = params.height;
|
|
3268
|
+
const gravity = params.gravity;
|
|
3269
|
+
const quality = params.quality;
|
|
3270
|
+
const borderWidth = params.borderWidth;
|
|
3271
|
+
const borderColor = params.borderColor;
|
|
3272
|
+
const borderRadius = params.borderRadius;
|
|
3273
|
+
const opacity = params.opacity;
|
|
3274
|
+
const rotation = params.rotation;
|
|
3275
|
+
const background = params.background;
|
|
3276
|
+
const output = params.output;
|
|
3277
|
+
const token = params.token;
|
|
3084
3278
|
if (typeof bucketId === 'undefined') {
|
|
3085
3279
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3086
3280
|
}
|
|
@@ -3132,18 +3326,21 @@ class Storage extends Service {
|
|
|
3132
3326
|
}
|
|
3133
3327
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
3134
3328
|
}
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3329
|
+
getFileView(paramsOrFirst, ...rest) {
|
|
3330
|
+
let params;
|
|
3331
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3332
|
+
params = (paramsOrFirst || {});
|
|
3333
|
+
}
|
|
3334
|
+
else {
|
|
3335
|
+
params = {
|
|
3336
|
+
bucketId: paramsOrFirst,
|
|
3337
|
+
fileId: rest[0],
|
|
3338
|
+
token: rest[1]
|
|
3339
|
+
};
|
|
3340
|
+
}
|
|
3341
|
+
const bucketId = params.bucketId;
|
|
3342
|
+
const fileId = params.fileId;
|
|
3343
|
+
const token = params.token;
|
|
3147
3344
|
if (typeof bucketId === 'undefined') {
|
|
3148
3345
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3149
3346
|
}
|
|
@@ -3282,20 +3479,344 @@ class Storage extends Service {
|
|
|
3282
3479
|
}
|
|
3283
3480
|
}
|
|
3284
3481
|
|
|
3285
|
-
class
|
|
3482
|
+
class TablesDB extends Service {
|
|
3286
3483
|
constructor(client) {
|
|
3287
3484
|
super(client);
|
|
3288
3485
|
}
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3486
|
+
listRows(paramsOrFirst, ...rest) {
|
|
3487
|
+
let params;
|
|
3488
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3489
|
+
params = (paramsOrFirst || {});
|
|
3490
|
+
}
|
|
3491
|
+
else {
|
|
3492
|
+
params = {
|
|
3493
|
+
databaseId: paramsOrFirst,
|
|
3494
|
+
tableId: rest[0],
|
|
3495
|
+
queries: rest[1]
|
|
3496
|
+
};
|
|
3497
|
+
}
|
|
3498
|
+
const databaseId = params.databaseId;
|
|
3499
|
+
const tableId = params.tableId;
|
|
3500
|
+
const queries = params.queries;
|
|
3501
|
+
if (typeof databaseId === 'undefined') {
|
|
3502
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3503
|
+
}
|
|
3504
|
+
if (typeof tableId === 'undefined') {
|
|
3505
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3506
|
+
}
|
|
3507
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
|
|
3508
|
+
const payload = {};
|
|
3509
|
+
if (typeof queries !== 'undefined') {
|
|
3510
|
+
payload['queries'] = queries;
|
|
3511
|
+
}
|
|
3512
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3513
|
+
return this.client.call('get', uri, {}, payload);
|
|
3514
|
+
}
|
|
3515
|
+
createRow(paramsOrFirst, ...rest) {
|
|
3516
|
+
let params;
|
|
3517
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3518
|
+
params = (paramsOrFirst || {});
|
|
3519
|
+
}
|
|
3520
|
+
else {
|
|
3521
|
+
params = {
|
|
3522
|
+
databaseId: paramsOrFirst,
|
|
3523
|
+
tableId: rest[0],
|
|
3524
|
+
rowId: rest[1],
|
|
3525
|
+
data: rest[2],
|
|
3526
|
+
permissions: rest[3]
|
|
3527
|
+
};
|
|
3528
|
+
}
|
|
3529
|
+
const databaseId = params.databaseId;
|
|
3530
|
+
const tableId = params.tableId;
|
|
3531
|
+
const rowId = params.rowId;
|
|
3532
|
+
const data = params.data;
|
|
3533
|
+
const permissions = params.permissions;
|
|
3534
|
+
if (typeof databaseId === 'undefined') {
|
|
3535
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3536
|
+
}
|
|
3537
|
+
if (typeof tableId === 'undefined') {
|
|
3538
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3539
|
+
}
|
|
3540
|
+
if (typeof rowId === 'undefined') {
|
|
3541
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3542
|
+
}
|
|
3543
|
+
if (typeof data === 'undefined') {
|
|
3544
|
+
throw new AppwriteException('Missing required parameter: "data"');
|
|
3545
|
+
}
|
|
3546
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
|
|
3547
|
+
const payload = {};
|
|
3548
|
+
if (typeof rowId !== 'undefined') {
|
|
3549
|
+
payload['rowId'] = rowId;
|
|
3550
|
+
}
|
|
3551
|
+
if (typeof data !== 'undefined') {
|
|
3552
|
+
payload['data'] = data;
|
|
3553
|
+
}
|
|
3554
|
+
if (typeof permissions !== 'undefined') {
|
|
3555
|
+
payload['permissions'] = permissions;
|
|
3556
|
+
}
|
|
3557
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3558
|
+
return this.client.call('post', uri, {
|
|
3559
|
+
'content-type': 'application/json',
|
|
3560
|
+
}, payload);
|
|
3561
|
+
}
|
|
3562
|
+
getRow(paramsOrFirst, ...rest) {
|
|
3563
|
+
let params;
|
|
3564
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3565
|
+
params = (paramsOrFirst || {});
|
|
3566
|
+
}
|
|
3567
|
+
else {
|
|
3568
|
+
params = {
|
|
3569
|
+
databaseId: paramsOrFirst,
|
|
3570
|
+
tableId: rest[0],
|
|
3571
|
+
rowId: rest[1],
|
|
3572
|
+
queries: rest[2]
|
|
3573
|
+
};
|
|
3574
|
+
}
|
|
3575
|
+
const databaseId = params.databaseId;
|
|
3576
|
+
const tableId = params.tableId;
|
|
3577
|
+
const rowId = params.rowId;
|
|
3578
|
+
const queries = params.queries;
|
|
3579
|
+
if (typeof databaseId === 'undefined') {
|
|
3580
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3581
|
+
}
|
|
3582
|
+
if (typeof tableId === 'undefined') {
|
|
3583
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3584
|
+
}
|
|
3585
|
+
if (typeof rowId === 'undefined') {
|
|
3586
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3587
|
+
}
|
|
3588
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
|
|
3589
|
+
const payload = {};
|
|
3590
|
+
if (typeof queries !== 'undefined') {
|
|
3591
|
+
payload['queries'] = queries;
|
|
3592
|
+
}
|
|
3593
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3594
|
+
return this.client.call('get', uri, {}, payload);
|
|
3595
|
+
}
|
|
3596
|
+
upsertRow(paramsOrFirst, ...rest) {
|
|
3597
|
+
let params;
|
|
3598
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3599
|
+
params = (paramsOrFirst || {});
|
|
3600
|
+
}
|
|
3601
|
+
else {
|
|
3602
|
+
params = {
|
|
3603
|
+
databaseId: paramsOrFirst,
|
|
3604
|
+
tableId: rest[0],
|
|
3605
|
+
rowId: rest[1],
|
|
3606
|
+
data: rest[2],
|
|
3607
|
+
permissions: rest[3]
|
|
3608
|
+
};
|
|
3609
|
+
}
|
|
3610
|
+
const databaseId = params.databaseId;
|
|
3611
|
+
const tableId = params.tableId;
|
|
3612
|
+
const rowId = params.rowId;
|
|
3613
|
+
const data = params.data;
|
|
3614
|
+
const permissions = params.permissions;
|
|
3615
|
+
if (typeof databaseId === 'undefined') {
|
|
3616
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3617
|
+
}
|
|
3618
|
+
if (typeof tableId === 'undefined') {
|
|
3619
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3620
|
+
}
|
|
3621
|
+
if (typeof rowId === 'undefined') {
|
|
3622
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3623
|
+
}
|
|
3624
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
|
|
3625
|
+
const payload = {};
|
|
3626
|
+
if (typeof data !== 'undefined') {
|
|
3627
|
+
payload['data'] = data;
|
|
3628
|
+
}
|
|
3629
|
+
if (typeof permissions !== 'undefined') {
|
|
3630
|
+
payload['permissions'] = permissions;
|
|
3631
|
+
}
|
|
3632
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3633
|
+
return this.client.call('put', uri, {
|
|
3634
|
+
'content-type': 'application/json',
|
|
3635
|
+
}, payload);
|
|
3636
|
+
}
|
|
3637
|
+
updateRow(paramsOrFirst, ...rest) {
|
|
3638
|
+
let params;
|
|
3639
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3640
|
+
params = (paramsOrFirst || {});
|
|
3641
|
+
}
|
|
3642
|
+
else {
|
|
3643
|
+
params = {
|
|
3644
|
+
databaseId: paramsOrFirst,
|
|
3645
|
+
tableId: rest[0],
|
|
3646
|
+
rowId: rest[1],
|
|
3647
|
+
data: rest[2],
|
|
3648
|
+
permissions: rest[3]
|
|
3649
|
+
};
|
|
3650
|
+
}
|
|
3651
|
+
const databaseId = params.databaseId;
|
|
3652
|
+
const tableId = params.tableId;
|
|
3653
|
+
const rowId = params.rowId;
|
|
3654
|
+
const data = params.data;
|
|
3655
|
+
const permissions = params.permissions;
|
|
3656
|
+
if (typeof databaseId === 'undefined') {
|
|
3657
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3658
|
+
}
|
|
3659
|
+
if (typeof tableId === 'undefined') {
|
|
3660
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3661
|
+
}
|
|
3662
|
+
if (typeof rowId === 'undefined') {
|
|
3663
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3664
|
+
}
|
|
3665
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
|
|
3666
|
+
const payload = {};
|
|
3667
|
+
if (typeof data !== 'undefined') {
|
|
3668
|
+
payload['data'] = data;
|
|
3669
|
+
}
|
|
3670
|
+
if (typeof permissions !== 'undefined') {
|
|
3671
|
+
payload['permissions'] = permissions;
|
|
3672
|
+
}
|
|
3673
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3674
|
+
return this.client.call('patch', uri, {
|
|
3675
|
+
'content-type': 'application/json',
|
|
3676
|
+
}, payload);
|
|
3677
|
+
}
|
|
3678
|
+
deleteRow(paramsOrFirst, ...rest) {
|
|
3679
|
+
let params;
|
|
3680
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3681
|
+
params = (paramsOrFirst || {});
|
|
3682
|
+
}
|
|
3683
|
+
else {
|
|
3684
|
+
params = {
|
|
3685
|
+
databaseId: paramsOrFirst,
|
|
3686
|
+
tableId: rest[0],
|
|
3687
|
+
rowId: rest[1]
|
|
3688
|
+
};
|
|
3689
|
+
}
|
|
3690
|
+
const databaseId = params.databaseId;
|
|
3691
|
+
const tableId = params.tableId;
|
|
3692
|
+
const rowId = params.rowId;
|
|
3693
|
+
if (typeof databaseId === 'undefined') {
|
|
3694
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3695
|
+
}
|
|
3696
|
+
if (typeof tableId === 'undefined') {
|
|
3697
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3698
|
+
}
|
|
3699
|
+
if (typeof rowId === 'undefined') {
|
|
3700
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3701
|
+
}
|
|
3702
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
|
|
3703
|
+
const payload = {};
|
|
3704
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3705
|
+
return this.client.call('delete', uri, {
|
|
3706
|
+
'content-type': 'application/json',
|
|
3707
|
+
}, payload);
|
|
3708
|
+
}
|
|
3709
|
+
decrementRowColumn(paramsOrFirst, ...rest) {
|
|
3710
|
+
let params;
|
|
3711
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3712
|
+
params = (paramsOrFirst || {});
|
|
3713
|
+
}
|
|
3714
|
+
else {
|
|
3715
|
+
params = {
|
|
3716
|
+
databaseId: paramsOrFirst,
|
|
3717
|
+
tableId: rest[0],
|
|
3718
|
+
rowId: rest[1],
|
|
3719
|
+
column: rest[2],
|
|
3720
|
+
value: rest[3],
|
|
3721
|
+
min: rest[4]
|
|
3722
|
+
};
|
|
3723
|
+
}
|
|
3724
|
+
const databaseId = params.databaseId;
|
|
3725
|
+
const tableId = params.tableId;
|
|
3726
|
+
const rowId = params.rowId;
|
|
3727
|
+
const column = params.column;
|
|
3728
|
+
const value = params.value;
|
|
3729
|
+
const min = params.min;
|
|
3730
|
+
if (typeof databaseId === 'undefined') {
|
|
3731
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3732
|
+
}
|
|
3733
|
+
if (typeof tableId === 'undefined') {
|
|
3734
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3735
|
+
}
|
|
3736
|
+
if (typeof rowId === 'undefined') {
|
|
3737
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3738
|
+
}
|
|
3739
|
+
if (typeof column === 'undefined') {
|
|
3740
|
+
throw new AppwriteException('Missing required parameter: "column"');
|
|
3741
|
+
}
|
|
3742
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
|
|
3743
|
+
const payload = {};
|
|
3744
|
+
if (typeof value !== 'undefined') {
|
|
3745
|
+
payload['value'] = value;
|
|
3746
|
+
}
|
|
3747
|
+
if (typeof min !== 'undefined') {
|
|
3748
|
+
payload['min'] = min;
|
|
3749
|
+
}
|
|
3750
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3751
|
+
return this.client.call('patch', uri, {
|
|
3752
|
+
'content-type': 'application/json',
|
|
3753
|
+
}, payload);
|
|
3754
|
+
}
|
|
3755
|
+
incrementRowColumn(paramsOrFirst, ...rest) {
|
|
3756
|
+
let params;
|
|
3757
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3758
|
+
params = (paramsOrFirst || {});
|
|
3759
|
+
}
|
|
3760
|
+
else {
|
|
3761
|
+
params = {
|
|
3762
|
+
databaseId: paramsOrFirst,
|
|
3763
|
+
tableId: rest[0],
|
|
3764
|
+
rowId: rest[1],
|
|
3765
|
+
column: rest[2],
|
|
3766
|
+
value: rest[3],
|
|
3767
|
+
max: rest[4]
|
|
3768
|
+
};
|
|
3769
|
+
}
|
|
3770
|
+
const databaseId = params.databaseId;
|
|
3771
|
+
const tableId = params.tableId;
|
|
3772
|
+
const rowId = params.rowId;
|
|
3773
|
+
const column = params.column;
|
|
3774
|
+
const value = params.value;
|
|
3775
|
+
const max = params.max;
|
|
3776
|
+
if (typeof databaseId === 'undefined') {
|
|
3777
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3778
|
+
}
|
|
3779
|
+
if (typeof tableId === 'undefined') {
|
|
3780
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3781
|
+
}
|
|
3782
|
+
if (typeof rowId === 'undefined') {
|
|
3783
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3784
|
+
}
|
|
3785
|
+
if (typeof column === 'undefined') {
|
|
3786
|
+
throw new AppwriteException('Missing required parameter: "column"');
|
|
3787
|
+
}
|
|
3788
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
|
|
3789
|
+
const payload = {};
|
|
3790
|
+
if (typeof value !== 'undefined') {
|
|
3791
|
+
payload['value'] = value;
|
|
3792
|
+
}
|
|
3793
|
+
if (typeof max !== 'undefined') {
|
|
3794
|
+
payload['max'] = max;
|
|
3795
|
+
}
|
|
3796
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3797
|
+
return this.client.call('patch', uri, {
|
|
3798
|
+
'content-type': 'application/json',
|
|
3799
|
+
}, payload);
|
|
3800
|
+
}
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
class Teams extends Service {
|
|
3804
|
+
constructor(client) {
|
|
3805
|
+
super(client);
|
|
3806
|
+
}
|
|
3807
|
+
list(paramsOrFirst, ...rest) {
|
|
3808
|
+
let params;
|
|
3809
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3810
|
+
params = (paramsOrFirst || {});
|
|
3811
|
+
}
|
|
3812
|
+
else {
|
|
3813
|
+
params = {
|
|
3814
|
+
queries: paramsOrFirst,
|
|
3815
|
+
search: rest[0]
|
|
3816
|
+
};
|
|
3817
|
+
}
|
|
3818
|
+
const queries = params.queries;
|
|
3819
|
+
const search = params.search;
|
|
3299
3820
|
const apiPath = '/teams';
|
|
3300
3821
|
const payload = {};
|
|
3301
3822
|
if (typeof queries !== 'undefined') {
|
|
@@ -3307,18 +3828,21 @@ class Teams extends Service {
|
|
|
3307
3828
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3308
3829
|
return this.client.call('get', uri, {}, payload);
|
|
3309
3830
|
}
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3831
|
+
create(paramsOrFirst, ...rest) {
|
|
3832
|
+
let params;
|
|
3833
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3834
|
+
params = (paramsOrFirst || {});
|
|
3835
|
+
}
|
|
3836
|
+
else {
|
|
3837
|
+
params = {
|
|
3838
|
+
teamId: paramsOrFirst,
|
|
3839
|
+
name: rest[0],
|
|
3840
|
+
roles: rest[1]
|
|
3841
|
+
};
|
|
3842
|
+
}
|
|
3843
|
+
const teamId = params.teamId;
|
|
3844
|
+
const name = params.name;
|
|
3845
|
+
const roles = params.roles;
|
|
3322
3846
|
if (typeof teamId === 'undefined') {
|
|
3323
3847
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3324
3848
|
}
|
|
@@ -3341,14 +3865,17 @@ class Teams extends Service {
|
|
|
3341
3865
|
'content-type': 'application/json',
|
|
3342
3866
|
}, payload);
|
|
3343
3867
|
}
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3868
|
+
get(paramsOrFirst) {
|
|
3869
|
+
let params;
|
|
3870
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3871
|
+
params = (paramsOrFirst || {});
|
|
3872
|
+
}
|
|
3873
|
+
else {
|
|
3874
|
+
params = {
|
|
3875
|
+
teamId: paramsOrFirst
|
|
3876
|
+
};
|
|
3877
|
+
}
|
|
3878
|
+
const teamId = params.teamId;
|
|
3352
3879
|
if (typeof teamId === 'undefined') {
|
|
3353
3880
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3354
3881
|
}
|
|
@@ -3357,15 +3884,19 @@ class Teams extends Service {
|
|
|
3357
3884
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3358
3885
|
return this.client.call('get', uri, {}, payload);
|
|
3359
3886
|
}
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3887
|
+
updateName(paramsOrFirst, ...rest) {
|
|
3888
|
+
let params;
|
|
3889
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3890
|
+
params = (paramsOrFirst || {});
|
|
3891
|
+
}
|
|
3892
|
+
else {
|
|
3893
|
+
params = {
|
|
3894
|
+
teamId: paramsOrFirst,
|
|
3895
|
+
name: rest[0]
|
|
3896
|
+
};
|
|
3897
|
+
}
|
|
3898
|
+
const teamId = params.teamId;
|
|
3899
|
+
const name = params.name;
|
|
3369
3900
|
if (typeof teamId === 'undefined') {
|
|
3370
3901
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3371
3902
|
}
|
|
@@ -3382,15 +3913,17 @@ class Teams extends Service {
|
|
|
3382
3913
|
'content-type': 'application/json',
|
|
3383
3914
|
}, payload);
|
|
3384
3915
|
}
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3916
|
+
delete(paramsOrFirst) {
|
|
3917
|
+
let params;
|
|
3918
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3919
|
+
params = (paramsOrFirst || {});
|
|
3920
|
+
}
|
|
3921
|
+
else {
|
|
3922
|
+
params = {
|
|
3923
|
+
teamId: paramsOrFirst
|
|
3924
|
+
};
|
|
3925
|
+
}
|
|
3926
|
+
const teamId = params.teamId;
|
|
3394
3927
|
if (typeof teamId === 'undefined') {
|
|
3395
3928
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3396
3929
|
}
|
|
@@ -3401,18 +3934,21 @@ class Teams extends Service {
|
|
|
3401
3934
|
'content-type': 'application/json',
|
|
3402
3935
|
}, payload);
|
|
3403
3936
|
}
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3937
|
+
listMemberships(paramsOrFirst, ...rest) {
|
|
3938
|
+
let params;
|
|
3939
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3940
|
+
params = (paramsOrFirst || {});
|
|
3941
|
+
}
|
|
3942
|
+
else {
|
|
3943
|
+
params = {
|
|
3944
|
+
teamId: paramsOrFirst,
|
|
3945
|
+
queries: rest[0],
|
|
3946
|
+
search: rest[1]
|
|
3947
|
+
};
|
|
3948
|
+
}
|
|
3949
|
+
const teamId = params.teamId;
|
|
3950
|
+
const queries = params.queries;
|
|
3951
|
+
const search = params.search;
|
|
3416
3952
|
if (typeof teamId === 'undefined') {
|
|
3417
3953
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3418
3954
|
}
|
|
@@ -3427,40 +3963,29 @@ class Teams extends Service {
|
|
|
3427
3963
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3428
3964
|
return this.client.call('get', uri, {}, payload);
|
|
3429
3965
|
}
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
* @param {string} teamId
|
|
3454
|
-
* @param {string[]} roles
|
|
3455
|
-
* @param {string} email
|
|
3456
|
-
* @param {string} userId
|
|
3457
|
-
* @param {string} phone
|
|
3458
|
-
* @param {string} url
|
|
3459
|
-
* @param {string} name
|
|
3460
|
-
* @throws {AppwriteException}
|
|
3461
|
-
* @returns {Promise}
|
|
3462
|
-
*/
|
|
3463
|
-
createMembership(teamId, roles, email, userId, phone, url, name) {
|
|
3966
|
+
createMembership(paramsOrFirst, ...rest) {
|
|
3967
|
+
let params;
|
|
3968
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3969
|
+
params = (paramsOrFirst || {});
|
|
3970
|
+
}
|
|
3971
|
+
else {
|
|
3972
|
+
params = {
|
|
3973
|
+
teamId: paramsOrFirst,
|
|
3974
|
+
roles: rest[0],
|
|
3975
|
+
email: rest[1],
|
|
3976
|
+
userId: rest[2],
|
|
3977
|
+
phone: rest[3],
|
|
3978
|
+
url: rest[4],
|
|
3979
|
+
name: rest[5]
|
|
3980
|
+
};
|
|
3981
|
+
}
|
|
3982
|
+
const teamId = params.teamId;
|
|
3983
|
+
const roles = params.roles;
|
|
3984
|
+
const email = params.email;
|
|
3985
|
+
const userId = params.userId;
|
|
3986
|
+
const phone = params.phone;
|
|
3987
|
+
const url = params.url;
|
|
3988
|
+
const name = params.name;
|
|
3464
3989
|
if (typeof teamId === 'undefined') {
|
|
3465
3990
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3466
3991
|
}
|
|
@@ -3492,17 +4017,19 @@ class Teams extends Service {
|
|
|
3492
4017
|
'content-type': 'application/json',
|
|
3493
4018
|
}, payload);
|
|
3494
4019
|
}
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
4020
|
+
getMembership(paramsOrFirst, ...rest) {
|
|
4021
|
+
let params;
|
|
4022
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4023
|
+
params = (paramsOrFirst || {});
|
|
4024
|
+
}
|
|
4025
|
+
else {
|
|
4026
|
+
params = {
|
|
4027
|
+
teamId: paramsOrFirst,
|
|
4028
|
+
membershipId: rest[0]
|
|
4029
|
+
};
|
|
4030
|
+
}
|
|
4031
|
+
const teamId = params.teamId;
|
|
4032
|
+
const membershipId = params.membershipId;
|
|
3506
4033
|
if (typeof teamId === 'undefined') {
|
|
3507
4034
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3508
4035
|
}
|
|
@@ -3514,19 +4041,21 @@ class Teams extends Service {
|
|
|
3514
4041
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3515
4042
|
return this.client.call('get', uri, {}, payload);
|
|
3516
4043
|
}
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
4044
|
+
updateMembership(paramsOrFirst, ...rest) {
|
|
4045
|
+
let params;
|
|
4046
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4047
|
+
params = (paramsOrFirst || {});
|
|
4048
|
+
}
|
|
4049
|
+
else {
|
|
4050
|
+
params = {
|
|
4051
|
+
teamId: paramsOrFirst,
|
|
4052
|
+
membershipId: rest[0],
|
|
4053
|
+
roles: rest[1]
|
|
4054
|
+
};
|
|
4055
|
+
}
|
|
4056
|
+
const teamId = params.teamId;
|
|
4057
|
+
const membershipId = params.membershipId;
|
|
4058
|
+
const roles = params.roles;
|
|
3530
4059
|
if (typeof teamId === 'undefined') {
|
|
3531
4060
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3532
4061
|
}
|
|
@@ -3546,17 +4075,19 @@ class Teams extends Service {
|
|
|
3546
4075
|
'content-type': 'application/json',
|
|
3547
4076
|
}, payload);
|
|
3548
4077
|
}
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
4078
|
+
deleteMembership(paramsOrFirst, ...rest) {
|
|
4079
|
+
let params;
|
|
4080
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4081
|
+
params = (paramsOrFirst || {});
|
|
4082
|
+
}
|
|
4083
|
+
else {
|
|
4084
|
+
params = {
|
|
4085
|
+
teamId: paramsOrFirst,
|
|
4086
|
+
membershipId: rest[0]
|
|
4087
|
+
};
|
|
4088
|
+
}
|
|
4089
|
+
const teamId = params.teamId;
|
|
4090
|
+
const membershipId = params.membershipId;
|
|
3560
4091
|
if (typeof teamId === 'undefined') {
|
|
3561
4092
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3562
4093
|
}
|
|
@@ -3570,23 +4101,23 @@ class Teams extends Service {
|
|
|
3570
4101
|
'content-type': 'application/json',
|
|
3571
4102
|
}, payload);
|
|
3572
4103
|
}
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
4104
|
+
updateMembershipStatus(paramsOrFirst, ...rest) {
|
|
4105
|
+
let params;
|
|
4106
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4107
|
+
params = (paramsOrFirst || {});
|
|
4108
|
+
}
|
|
4109
|
+
else {
|
|
4110
|
+
params = {
|
|
4111
|
+
teamId: paramsOrFirst,
|
|
4112
|
+
membershipId: rest[0],
|
|
4113
|
+
userId: rest[1],
|
|
4114
|
+
secret: rest[2]
|
|
4115
|
+
};
|
|
4116
|
+
}
|
|
4117
|
+
const teamId = params.teamId;
|
|
4118
|
+
const membershipId = params.membershipId;
|
|
4119
|
+
const userId = params.userId;
|
|
4120
|
+
const secret = params.secret;
|
|
3590
4121
|
if (typeof teamId === 'undefined') {
|
|
3591
4122
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3592
4123
|
}
|
|
@@ -3612,16 +4143,17 @@ class Teams extends Service {
|
|
|
3612
4143
|
'content-type': 'application/json',
|
|
3613
4144
|
}, payload);
|
|
3614
4145
|
}
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
4146
|
+
getPrefs(paramsOrFirst) {
|
|
4147
|
+
let params;
|
|
4148
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4149
|
+
params = (paramsOrFirst || {});
|
|
4150
|
+
}
|
|
4151
|
+
else {
|
|
4152
|
+
params = {
|
|
4153
|
+
teamId: paramsOrFirst
|
|
4154
|
+
};
|
|
4155
|
+
}
|
|
4156
|
+
const teamId = params.teamId;
|
|
3625
4157
|
if (typeof teamId === 'undefined') {
|
|
3626
4158
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3627
4159
|
}
|
|
@@ -3630,17 +4162,19 @@ class Teams extends Service {
|
|
|
3630
4162
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3631
4163
|
return this.client.call('get', uri, {}, payload);
|
|
3632
4164
|
}
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
4165
|
+
updatePrefs(paramsOrFirst, ...rest) {
|
|
4166
|
+
let params;
|
|
4167
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4168
|
+
params = (paramsOrFirst || {});
|
|
4169
|
+
}
|
|
4170
|
+
else {
|
|
4171
|
+
params = {
|
|
4172
|
+
teamId: paramsOrFirst,
|
|
4173
|
+
prefs: rest[0]
|
|
4174
|
+
};
|
|
4175
|
+
}
|
|
4176
|
+
const teamId = params.teamId;
|
|
4177
|
+
const prefs = params.prefs;
|
|
3644
4178
|
if (typeof teamId === 'undefined') {
|
|
3645
4179
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3646
4180
|
}
|
|
@@ -3699,9 +4233,206 @@ Query.cursorAfter = (documentId) => new Query("cursorAfter", undefined, document
|
|
|
3699
4233
|
Query.cursorBefore = (documentId) => new Query("cursorBefore", undefined, documentId).toString();
|
|
3700
4234
|
Query.limit = (limit) => new Query("limit", undefined, limit).toString();
|
|
3701
4235
|
Query.offset = (offset) => new Query("offset", undefined, offset).toString();
|
|
4236
|
+
/**
|
|
4237
|
+
* Filter resources where attribute contains the specified value.
|
|
4238
|
+
*
|
|
4239
|
+
* @param {string} attribute
|
|
4240
|
+
* @param {string | string[]} value
|
|
4241
|
+
* @returns {string}
|
|
4242
|
+
*/
|
|
3702
4243
|
Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
|
|
4244
|
+
/**
|
|
4245
|
+
* Filter resources where attribute does not contain the specified value.
|
|
4246
|
+
*
|
|
4247
|
+
* @param {string} attribute
|
|
4248
|
+
* @param {string | string[]} value
|
|
4249
|
+
* @returns {string}
|
|
4250
|
+
*/
|
|
4251
|
+
Query.notContains = (attribute, value) => new Query("notContains", attribute, value).toString();
|
|
4252
|
+
/**
|
|
4253
|
+
* Filter resources by searching attribute for value (inverse of search).
|
|
4254
|
+
* A fulltext index on attribute is required for this query to work.
|
|
4255
|
+
*
|
|
4256
|
+
* @param {string} attribute
|
|
4257
|
+
* @param {string} value
|
|
4258
|
+
* @returns {string}
|
|
4259
|
+
*/
|
|
4260
|
+
Query.notSearch = (attribute, value) => new Query("notSearch", attribute, value).toString();
|
|
4261
|
+
/**
|
|
4262
|
+
* Filter resources where attribute is not between start and end (exclusive).
|
|
4263
|
+
*
|
|
4264
|
+
* @param {string} attribute
|
|
4265
|
+
* @param {string | number} start
|
|
4266
|
+
* @param {string | number} end
|
|
4267
|
+
* @returns {string}
|
|
4268
|
+
*/
|
|
4269
|
+
Query.notBetween = (attribute, start, end) => new Query("notBetween", attribute, [start, end]).toString();
|
|
4270
|
+
/**
|
|
4271
|
+
* Filter resources where attribute does not start with value.
|
|
4272
|
+
*
|
|
4273
|
+
* @param {string} attribute
|
|
4274
|
+
* @param {string} value
|
|
4275
|
+
* @returns {string}
|
|
4276
|
+
*/
|
|
4277
|
+
Query.notStartsWith = (attribute, value) => new Query("notStartsWith", attribute, value).toString();
|
|
4278
|
+
/**
|
|
4279
|
+
* Filter resources where attribute does not end with value.
|
|
4280
|
+
*
|
|
4281
|
+
* @param {string} attribute
|
|
4282
|
+
* @param {string} value
|
|
4283
|
+
* @returns {string}
|
|
4284
|
+
*/
|
|
4285
|
+
Query.notEndsWith = (attribute, value) => new Query("notEndsWith", attribute, value).toString();
|
|
4286
|
+
/**
|
|
4287
|
+
* Filter resources where document was created before date.
|
|
4288
|
+
*
|
|
4289
|
+
* @param {string} value
|
|
4290
|
+
* @returns {string}
|
|
4291
|
+
*/
|
|
4292
|
+
Query.createdBefore = (value) => new Query("createdBefore", undefined, value).toString();
|
|
4293
|
+
/**
|
|
4294
|
+
* Filter resources where document was created after date.
|
|
4295
|
+
*
|
|
4296
|
+
* @param {string} value
|
|
4297
|
+
* @returns {string}
|
|
4298
|
+
*/
|
|
4299
|
+
Query.createdAfter = (value) => new Query("createdAfter", undefined, value).toString();
|
|
4300
|
+
/**
|
|
4301
|
+
* Filter resources where document was created between dates.
|
|
4302
|
+
*
|
|
4303
|
+
* @param {string} start
|
|
4304
|
+
* @param {string} end
|
|
4305
|
+
* @returns {string}
|
|
4306
|
+
*/
|
|
4307
|
+
Query.createdBetween = (start, end) => new Query("createdBetween", undefined, [start, end]).toString();
|
|
4308
|
+
/**
|
|
4309
|
+
* Filter resources where document was updated before date.
|
|
4310
|
+
*
|
|
4311
|
+
* @param {string} value
|
|
4312
|
+
* @returns {string}
|
|
4313
|
+
*/
|
|
4314
|
+
Query.updatedBefore = (value) => new Query("updatedBefore", undefined, value).toString();
|
|
4315
|
+
/**
|
|
4316
|
+
* Filter resources where document was updated after date.
|
|
4317
|
+
*
|
|
4318
|
+
* @param {string} value
|
|
4319
|
+
* @returns {string}
|
|
4320
|
+
*/
|
|
4321
|
+
Query.updatedAfter = (value) => new Query("updatedAfter", undefined, value).toString();
|
|
4322
|
+
/**
|
|
4323
|
+
* Filter resources where document was updated between dates.
|
|
4324
|
+
*
|
|
4325
|
+
* @param {string} start
|
|
4326
|
+
* @param {string} end
|
|
4327
|
+
* @returns {string}
|
|
4328
|
+
*/
|
|
4329
|
+
Query.updatedBetween = (start, end) => new Query("updatedBetween", undefined, [start, end]).toString();
|
|
3703
4330
|
Query.or = (queries) => new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString();
|
|
3704
4331
|
Query.and = (queries) => new Query("and", undefined, queries.map((query) => JSON.parse(query))).toString();
|
|
4332
|
+
/**
|
|
4333
|
+
* Filter resources where attribute is at a specific distance from the given coordinates.
|
|
4334
|
+
*
|
|
4335
|
+
* @param {string} attribute
|
|
4336
|
+
* @param {any[]} values
|
|
4337
|
+
* @param {number} distance
|
|
4338
|
+
* @param {boolean} meters
|
|
4339
|
+
* @returns {string}
|
|
4340
|
+
*/
|
|
4341
|
+
Query.distanceEqual = (attribute, values, distance, meters = true) => new Query("distanceEqual", attribute, [[values, distance, meters]]).toString();
|
|
4342
|
+
/**
|
|
4343
|
+
* Filter resources where attribute is not at a specific distance from the given coordinates.
|
|
4344
|
+
*
|
|
4345
|
+
* @param {string} attribute
|
|
4346
|
+
* @param {any[]} values
|
|
4347
|
+
* @param {number} distance
|
|
4348
|
+
* @param {boolean} meters
|
|
4349
|
+
* @returns {string}
|
|
4350
|
+
*/
|
|
4351
|
+
Query.distanceNotEqual = (attribute, values, distance, meters = true) => new Query("distanceNotEqual", attribute, [[values, distance, meters]]).toString();
|
|
4352
|
+
/**
|
|
4353
|
+
* Filter resources where attribute is at a distance greater than the specified value from the given coordinates.
|
|
4354
|
+
*
|
|
4355
|
+
* @param {string} attribute
|
|
4356
|
+
* @param {any[]} values
|
|
4357
|
+
* @param {number} distance
|
|
4358
|
+
* @param {boolean} meters
|
|
4359
|
+
* @returns {string}
|
|
4360
|
+
*/
|
|
4361
|
+
Query.distanceGreaterThan = (attribute, values, distance, meters = true) => new Query("distanceGreaterThan", attribute, [[values, distance, meters]]).toString();
|
|
4362
|
+
/**
|
|
4363
|
+
* Filter resources where attribute is at a distance less than the specified value from the given coordinates.
|
|
4364
|
+
*
|
|
4365
|
+
* @param {string} attribute
|
|
4366
|
+
* @param {any[]} values
|
|
4367
|
+
* @param {number} distance
|
|
4368
|
+
* @param {boolean} meters
|
|
4369
|
+
* @returns {string}
|
|
4370
|
+
*/
|
|
4371
|
+
Query.distanceLessThan = (attribute, values, distance, meters = true) => new Query("distanceLessThan", attribute, [[values, distance, meters]]).toString();
|
|
4372
|
+
/**
|
|
4373
|
+
* Filter resources where attribute intersects with the given geometry.
|
|
4374
|
+
*
|
|
4375
|
+
* @param {string} attribute
|
|
4376
|
+
* @param {any[]} values
|
|
4377
|
+
* @returns {string}
|
|
4378
|
+
*/
|
|
4379
|
+
Query.intersects = (attribute, values) => new Query("intersects", attribute, [values]).toString();
|
|
4380
|
+
/**
|
|
4381
|
+
* Filter resources where attribute does not intersect with the given geometry.
|
|
4382
|
+
*
|
|
4383
|
+
* @param {string} attribute
|
|
4384
|
+
* @param {any[]} values
|
|
4385
|
+
* @returns {string}
|
|
4386
|
+
*/
|
|
4387
|
+
Query.notIntersects = (attribute, values) => new Query("notIntersects", attribute, [values]).toString();
|
|
4388
|
+
/**
|
|
4389
|
+
* Filter resources where attribute crosses the given geometry.
|
|
4390
|
+
*
|
|
4391
|
+
* @param {string} attribute
|
|
4392
|
+
* @param {any[]} values
|
|
4393
|
+
* @returns {string}
|
|
4394
|
+
*/
|
|
4395
|
+
Query.crosses = (attribute, values) => new Query("crosses", attribute, [values]).toString();
|
|
4396
|
+
/**
|
|
4397
|
+
* Filter resources where attribute does not cross the given geometry.
|
|
4398
|
+
*
|
|
4399
|
+
* @param {string} attribute
|
|
4400
|
+
* @param {any[]} values
|
|
4401
|
+
* @returns {string}
|
|
4402
|
+
*/
|
|
4403
|
+
Query.notCrosses = (attribute, values) => new Query("notCrosses", attribute, [values]).toString();
|
|
4404
|
+
/**
|
|
4405
|
+
* Filter resources where attribute overlaps with the given geometry.
|
|
4406
|
+
*
|
|
4407
|
+
* @param {string} attribute
|
|
4408
|
+
* @param {any[]} values
|
|
4409
|
+
* @returns {string}
|
|
4410
|
+
*/
|
|
4411
|
+
Query.overlaps = (attribute, values) => new Query("overlaps", attribute, [values]).toString();
|
|
4412
|
+
/**
|
|
4413
|
+
* Filter resources where attribute does not overlap with the given geometry.
|
|
4414
|
+
*
|
|
4415
|
+
* @param {string} attribute
|
|
4416
|
+
* @param {any[]} values
|
|
4417
|
+
* @returns {string}
|
|
4418
|
+
*/
|
|
4419
|
+
Query.notOverlaps = (attribute, values) => new Query("notOverlaps", attribute, [values]).toString();
|
|
4420
|
+
/**
|
|
4421
|
+
* Filter resources where attribute touches the given geometry.
|
|
4422
|
+
*
|
|
4423
|
+
* @param {string} attribute
|
|
4424
|
+
* @param {any[]} values
|
|
4425
|
+
* @returns {string}
|
|
4426
|
+
*/
|
|
4427
|
+
Query.touches = (attribute, values) => new Query("touches", attribute, [values]).toString();
|
|
4428
|
+
/**
|
|
4429
|
+
* Filter resources where attribute does not touch the given geometry.
|
|
4430
|
+
*
|
|
4431
|
+
* @param {string} attribute
|
|
4432
|
+
* @param {any[]} values
|
|
4433
|
+
* @returns {string}
|
|
4434
|
+
*/
|
|
4435
|
+
Query.notTouches = (attribute, values) => new Query("notTouches", attribute, [values]).toString();
|
|
3705
4436
|
|
|
3706
4437
|
class Permission {
|
|
3707
4438
|
}
|
|
@@ -3929,7 +4660,7 @@ var CreditCard;
|
|
|
3929
4660
|
CreditCard["Mastercard"] = "mastercard";
|
|
3930
4661
|
CreditCard["Naranja"] = "naranja";
|
|
3931
4662
|
CreditCard["TarjetaShopping"] = "targeta-shopping";
|
|
3932
|
-
CreditCard["
|
|
4663
|
+
CreditCard["UnionPay"] = "unionpay";
|
|
3933
4664
|
CreditCard["Visa"] = "visa";
|
|
3934
4665
|
CreditCard["MIR"] = "mir";
|
|
3935
4666
|
CreditCard["Maestro"] = "maestro";
|
|
@@ -4143,6 +4874,7 @@ var ExecutionMethod;
|
|
|
4143
4874
|
ExecutionMethod["PATCH"] = "PATCH";
|
|
4144
4875
|
ExecutionMethod["DELETE"] = "DELETE";
|
|
4145
4876
|
ExecutionMethod["OPTIONS"] = "OPTIONS";
|
|
4877
|
+
ExecutionMethod["HEAD"] = "HEAD";
|
|
4146
4878
|
})(ExecutionMethod || (ExecutionMethod = {}));
|
|
4147
4879
|
|
|
4148
4880
|
var ImageGravity;
|
|
@@ -4169,5 +4901,5 @@ var ImageFormat;
|
|
|
4169
4901
|
ImageFormat["Gif"] = "gif";
|
|
4170
4902
|
})(ImageFormat || (ImageFormat = {}));
|
|
4171
4903
|
|
|
4172
|
-
export { Account, AppwriteException, AuthenticationFactor, AuthenticatorType, Avatars, Browser, Client, CreditCard, Databases, ExecutionMethod, Flag, Functions, Graphql, ID, ImageFormat, ImageGravity, Locale, Messaging, OAuthProvider, Permission, Query, Role, Storage, Teams };
|
|
4904
|
+
export { Account, AppwriteException, AuthenticationFactor, AuthenticatorType, Avatars, Browser, Client, CreditCard, Databases, ExecutionMethod, Flag, Functions, Graphql, ID, ImageFormat, ImageGravity, Locale, Messaging, OAuthProvider, Permission, Query, Role, Storage, TablesDB, Teams };
|
|
4173
4905
|
//# sourceMappingURL=sdk.js.map
|