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/cjs/sdk.js
CHANGED
|
@@ -100,8 +100,8 @@ class Client {
|
|
|
100
100
|
'x-sdk-name': 'React Native',
|
|
101
101
|
'x-sdk-platform': 'client',
|
|
102
102
|
'x-sdk-language': 'reactnative',
|
|
103
|
-
'x-sdk-version': '0.
|
|
104
|
-
'X-Appwrite-Response-Format': '1.
|
|
103
|
+
'x-sdk-version': '0.13.0',
|
|
104
|
+
'X-Appwrite-Response-Format': '1.8.0',
|
|
105
105
|
};
|
|
106
106
|
this.realtime = {
|
|
107
107
|
socket: undefined,
|
|
@@ -492,23 +492,23 @@ class Account extends Service {
|
|
|
492
492
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
493
493
|
return this.client.call('get', uri, {}, payload);
|
|
494
494
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
495
|
+
create(paramsOrFirst, ...rest) {
|
|
496
|
+
let params;
|
|
497
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
498
|
+
params = (paramsOrFirst || {});
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
params = {
|
|
502
|
+
userId: paramsOrFirst,
|
|
503
|
+
email: rest[0],
|
|
504
|
+
password: rest[1],
|
|
505
|
+
name: rest[2]
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
const userId = params.userId;
|
|
509
|
+
const email = params.email;
|
|
510
|
+
const password = params.password;
|
|
511
|
+
const name = params.name;
|
|
512
512
|
if (typeof userId === 'undefined') {
|
|
513
513
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
514
514
|
}
|
|
@@ -537,22 +537,19 @@ class Account extends Service {
|
|
|
537
537
|
'content-type': 'application/json',
|
|
538
538
|
}, payload);
|
|
539
539
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
* @returns {Promise}
|
|
554
|
-
*/
|
|
555
|
-
updateEmail(email, password) {
|
|
540
|
+
updateEmail(paramsOrFirst, ...rest) {
|
|
541
|
+
let params;
|
|
542
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
543
|
+
params = (paramsOrFirst || {});
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
params = {
|
|
547
|
+
email: paramsOrFirst,
|
|
548
|
+
password: rest[0]
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
const email = params.email;
|
|
552
|
+
const password = params.password;
|
|
556
553
|
if (typeof email === 'undefined') {
|
|
557
554
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
558
555
|
}
|
|
@@ -572,14 +569,17 @@ class Account extends Service {
|
|
|
572
569
|
'content-type': 'application/json',
|
|
573
570
|
}, payload);
|
|
574
571
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
572
|
+
listIdentities(paramsOrFirst) {
|
|
573
|
+
let params;
|
|
574
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
575
|
+
params = (paramsOrFirst || {});
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
params = {
|
|
579
|
+
queries: paramsOrFirst
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
const queries = params.queries;
|
|
583
583
|
const apiPath = '/account/identities';
|
|
584
584
|
const payload = {};
|
|
585
585
|
if (typeof queries !== 'undefined') {
|
|
@@ -588,14 +588,17 @@ class Account extends Service {
|
|
|
588
588
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
589
589
|
return this.client.call('get', uri, {}, payload);
|
|
590
590
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
591
|
+
deleteIdentity(paramsOrFirst) {
|
|
592
|
+
let params;
|
|
593
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
594
|
+
params = (paramsOrFirst || {});
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
params = {
|
|
598
|
+
identityId: paramsOrFirst
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
const identityId = params.identityId;
|
|
599
602
|
if (typeof identityId === 'undefined') {
|
|
600
603
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
601
604
|
}
|
|
@@ -607,11 +610,7 @@ class Account extends Service {
|
|
|
607
610
|
}, payload);
|
|
608
611
|
}
|
|
609
612
|
/**
|
|
610
|
-
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT
|
|
611
|
-
* to authenticate on behalf of the current user when working with the
|
|
612
|
-
* Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes
|
|
613
|
-
* from its creation and will be invalid if the user will logout in that time
|
|
614
|
-
* frame.
|
|
613
|
+
* 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.
|
|
615
614
|
*
|
|
616
615
|
* @throws {AppwriteException}
|
|
617
616
|
* @returns {Promise}
|
|
@@ -624,15 +623,17 @@ class Account extends Service {
|
|
|
624
623
|
'content-type': 'application/json',
|
|
625
624
|
}, payload);
|
|
626
625
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
626
|
+
listLogs(paramsOrFirst) {
|
|
627
|
+
let params;
|
|
628
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
629
|
+
params = (paramsOrFirst || {});
|
|
630
|
+
}
|
|
631
|
+
else {
|
|
632
|
+
params = {
|
|
633
|
+
queries: paramsOrFirst
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
const queries = params.queries;
|
|
636
637
|
const apiPath = '/account/logs';
|
|
637
638
|
const payload = {};
|
|
638
639
|
if (typeof queries !== 'undefined') {
|
|
@@ -641,14 +642,17 @@ class Account extends Service {
|
|
|
641
642
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
642
643
|
return this.client.call('get', uri, {}, payload);
|
|
643
644
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
645
|
+
updateMFA(paramsOrFirst) {
|
|
646
|
+
let params;
|
|
647
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
648
|
+
params = (paramsOrFirst || {});
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
params = {
|
|
652
|
+
mfa: paramsOrFirst
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
const mfa = params.mfa;
|
|
652
656
|
if (typeof mfa === 'undefined') {
|
|
653
657
|
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
654
658
|
}
|
|
@@ -662,17 +666,17 @@ class Account extends Service {
|
|
|
662
666
|
'content-type': 'application/json',
|
|
663
667
|
}, payload);
|
|
664
668
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
669
|
+
createMfaAuthenticator(paramsOrFirst) {
|
|
670
|
+
let params;
|
|
671
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
672
|
+
params = (paramsOrFirst || {});
|
|
673
|
+
}
|
|
674
|
+
else {
|
|
675
|
+
params = {
|
|
676
|
+
type: paramsOrFirst
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
const type = params.type;
|
|
676
680
|
if (typeof type === 'undefined') {
|
|
677
681
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
678
682
|
}
|
|
@@ -683,17 +687,40 @@ class Account extends Service {
|
|
|
683
687
|
'content-type': 'application/json',
|
|
684
688
|
}, payload);
|
|
685
689
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
690
|
+
createMFAAuthenticator(paramsOrFirst) {
|
|
691
|
+
let params;
|
|
692
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
693
|
+
params = (paramsOrFirst || {});
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
params = {
|
|
697
|
+
type: paramsOrFirst
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
const type = params.type;
|
|
701
|
+
if (typeof type === 'undefined') {
|
|
702
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
703
|
+
}
|
|
704
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
705
|
+
const payload = {};
|
|
706
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
707
|
+
return this.client.call('post', uri, {
|
|
708
|
+
'content-type': 'application/json',
|
|
709
|
+
}, payload);
|
|
710
|
+
}
|
|
711
|
+
updateMfaAuthenticator(paramsOrFirst, ...rest) {
|
|
712
|
+
let params;
|
|
713
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
714
|
+
params = (paramsOrFirst || {});
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
params = {
|
|
718
|
+
type: paramsOrFirst,
|
|
719
|
+
otp: rest[0]
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
const type = params.type;
|
|
723
|
+
const otp = params.otp;
|
|
697
724
|
if (typeof type === 'undefined') {
|
|
698
725
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
699
726
|
}
|
|
@@ -710,14 +737,46 @@ class Account extends Service {
|
|
|
710
737
|
'content-type': 'application/json',
|
|
711
738
|
}, payload);
|
|
712
739
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
740
|
+
updateMFAAuthenticator(paramsOrFirst, ...rest) {
|
|
741
|
+
let params;
|
|
742
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
743
|
+
params = (paramsOrFirst || {});
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
params = {
|
|
747
|
+
type: paramsOrFirst,
|
|
748
|
+
otp: rest[0]
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
const type = params.type;
|
|
752
|
+
const otp = params.otp;
|
|
753
|
+
if (typeof type === 'undefined') {
|
|
754
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
755
|
+
}
|
|
756
|
+
if (typeof otp === 'undefined') {
|
|
757
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
758
|
+
}
|
|
759
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
760
|
+
const payload = {};
|
|
761
|
+
if (typeof otp !== 'undefined') {
|
|
762
|
+
payload['otp'] = otp;
|
|
763
|
+
}
|
|
764
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
765
|
+
return this.client.call('put', uri, {
|
|
766
|
+
'content-type': 'application/json',
|
|
767
|
+
}, payload);
|
|
768
|
+
}
|
|
769
|
+
deleteMfaAuthenticator(paramsOrFirst) {
|
|
770
|
+
let params;
|
|
771
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
772
|
+
params = (paramsOrFirst || {});
|
|
773
|
+
}
|
|
774
|
+
else {
|
|
775
|
+
params = {
|
|
776
|
+
type: paramsOrFirst
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
const type = params.type;
|
|
721
780
|
if (typeof type === 'undefined') {
|
|
722
781
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
723
782
|
}
|
|
@@ -728,16 +787,38 @@ class Account extends Service {
|
|
|
728
787
|
'content-type': 'application/json',
|
|
729
788
|
}, payload);
|
|
730
789
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
790
|
+
deleteMFAAuthenticator(paramsOrFirst) {
|
|
791
|
+
let params;
|
|
792
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
793
|
+
params = (paramsOrFirst || {});
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
params = {
|
|
797
|
+
type: paramsOrFirst
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
const type = params.type;
|
|
801
|
+
if (typeof type === 'undefined') {
|
|
802
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
803
|
+
}
|
|
804
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
805
|
+
const payload = {};
|
|
806
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
807
|
+
return this.client.call('delete', uri, {
|
|
808
|
+
'content-type': 'application/json',
|
|
809
|
+
}, payload);
|
|
810
|
+
}
|
|
811
|
+
createMfaChallenge(paramsOrFirst) {
|
|
812
|
+
let params;
|
|
813
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
814
|
+
params = (paramsOrFirst || {});
|
|
815
|
+
}
|
|
816
|
+
else {
|
|
817
|
+
params = {
|
|
818
|
+
factor: paramsOrFirst
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
const factor = params.factor;
|
|
741
822
|
if (typeof factor === 'undefined') {
|
|
742
823
|
throw new AppwriteException('Missing required parameter: "factor"');
|
|
743
824
|
}
|
|
@@ -751,19 +832,75 @@ class Account extends Service {
|
|
|
751
832
|
'content-type': 'application/json',
|
|
752
833
|
}, payload);
|
|
753
834
|
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
835
|
+
createMFAChallenge(paramsOrFirst) {
|
|
836
|
+
let params;
|
|
837
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
838
|
+
params = (paramsOrFirst || {});
|
|
839
|
+
}
|
|
840
|
+
else {
|
|
841
|
+
params = {
|
|
842
|
+
factor: paramsOrFirst
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
const factor = params.factor;
|
|
846
|
+
if (typeof factor === 'undefined') {
|
|
847
|
+
throw new AppwriteException('Missing required parameter: "factor"');
|
|
848
|
+
}
|
|
849
|
+
const apiPath = '/account/mfa/challenge';
|
|
850
|
+
const payload = {};
|
|
851
|
+
if (typeof factor !== 'undefined') {
|
|
852
|
+
payload['factor'] = factor;
|
|
853
|
+
}
|
|
854
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
855
|
+
return this.client.call('post', uri, {
|
|
856
|
+
'content-type': 'application/json',
|
|
857
|
+
}, payload);
|
|
858
|
+
}
|
|
859
|
+
updateMfaChallenge(paramsOrFirst, ...rest) {
|
|
860
|
+
let params;
|
|
861
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
862
|
+
params = (paramsOrFirst || {});
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
params = {
|
|
866
|
+
challengeId: paramsOrFirst,
|
|
867
|
+
otp: rest[0]
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
const challengeId = params.challengeId;
|
|
871
|
+
const otp = params.otp;
|
|
872
|
+
if (typeof challengeId === 'undefined') {
|
|
873
|
+
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
874
|
+
}
|
|
875
|
+
if (typeof otp === 'undefined') {
|
|
876
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
877
|
+
}
|
|
878
|
+
const apiPath = '/account/mfa/challenge';
|
|
879
|
+
const payload = {};
|
|
880
|
+
if (typeof challengeId !== 'undefined') {
|
|
881
|
+
payload['challengeId'] = challengeId;
|
|
882
|
+
}
|
|
883
|
+
if (typeof otp !== 'undefined') {
|
|
884
|
+
payload['otp'] = otp;
|
|
885
|
+
}
|
|
886
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
887
|
+
return this.client.call('put', uri, {
|
|
888
|
+
'content-type': 'application/json',
|
|
889
|
+
}, payload);
|
|
890
|
+
}
|
|
891
|
+
updateMFAChallenge(paramsOrFirst, ...rest) {
|
|
892
|
+
let params;
|
|
893
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
894
|
+
params = (paramsOrFirst || {});
|
|
895
|
+
}
|
|
896
|
+
else {
|
|
897
|
+
params = {
|
|
898
|
+
challengeId: paramsOrFirst,
|
|
899
|
+
otp: rest[0]
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
const challengeId = params.challengeId;
|
|
903
|
+
const otp = params.otp;
|
|
767
904
|
if (typeof challengeId === 'undefined') {
|
|
768
905
|
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
769
906
|
}
|
|
@@ -788,6 +925,7 @@ class Account extends Service {
|
|
|
788
925
|
*
|
|
789
926
|
* @throws {AppwriteException}
|
|
790
927
|
* @returns {Promise}
|
|
928
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Account.listMFAFactors` instead.
|
|
791
929
|
*/
|
|
792
930
|
listMfaFactors() {
|
|
793
931
|
const apiPath = '/account/mfa/factors';
|
|
@@ -796,13 +934,23 @@ class Account extends Service {
|
|
|
796
934
|
return this.client.call('get', uri, {}, payload);
|
|
797
935
|
}
|
|
798
936
|
/**
|
|
799
|
-
*
|
|
800
|
-
*
|
|
801
|
-
*
|
|
802
|
-
*
|
|
937
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
938
|
+
*
|
|
939
|
+
* @throws {AppwriteException}
|
|
940
|
+
* @returns {Promise}
|
|
941
|
+
*/
|
|
942
|
+
listMFAFactors() {
|
|
943
|
+
const apiPath = '/account/mfa/factors';
|
|
944
|
+
const payload = {};
|
|
945
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
946
|
+
return this.client.call('get', uri, {}, payload);
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* 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.
|
|
803
950
|
*
|
|
804
951
|
* @throws {AppwriteException}
|
|
805
952
|
* @returns {Promise}
|
|
953
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Account.getMFARecoveryCodes` instead.
|
|
806
954
|
*/
|
|
807
955
|
getMfaRecoveryCodes() {
|
|
808
956
|
const apiPath = '/account/mfa/recovery-codes';
|
|
@@ -811,14 +959,23 @@ class Account extends Service {
|
|
|
811
959
|
return this.client.call('get', uri, {}, payload);
|
|
812
960
|
}
|
|
813
961
|
/**
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
|
|
962
|
+
* 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.
|
|
963
|
+
*
|
|
964
|
+
* @throws {AppwriteException}
|
|
965
|
+
* @returns {Promise}
|
|
966
|
+
*/
|
|
967
|
+
getMFARecoveryCodes() {
|
|
968
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
969
|
+
const payload = {};
|
|
970
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
971
|
+
return this.client.call('get', uri, {}, payload);
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* 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.
|
|
819
975
|
*
|
|
820
976
|
* @throws {AppwriteException}
|
|
821
977
|
* @returns {Promise}
|
|
978
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFARecoveryCodes` instead.
|
|
822
979
|
*/
|
|
823
980
|
createMfaRecoveryCodes() {
|
|
824
981
|
const apiPath = '/account/mfa/recovery-codes';
|
|
@@ -829,13 +986,25 @@ class Account extends Service {
|
|
|
829
986
|
}, payload);
|
|
830
987
|
}
|
|
831
988
|
/**
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
835
|
-
*
|
|
989
|
+
* 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.
|
|
990
|
+
*
|
|
991
|
+
* @throws {AppwriteException}
|
|
992
|
+
* @returns {Promise}
|
|
993
|
+
*/
|
|
994
|
+
createMFARecoveryCodes() {
|
|
995
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
996
|
+
const payload = {};
|
|
997
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
998
|
+
return this.client.call('post', uri, {
|
|
999
|
+
'content-type': 'application/json',
|
|
1000
|
+
}, payload);
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* 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.
|
|
836
1004
|
*
|
|
837
1005
|
* @throws {AppwriteException}
|
|
838
1006
|
* @returns {Promise}
|
|
1007
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFARecoveryCodes` instead.
|
|
839
1008
|
*/
|
|
840
1009
|
updateMfaRecoveryCodes() {
|
|
841
1010
|
const apiPath = '/account/mfa/recovery-codes';
|
|
@@ -846,13 +1015,30 @@ class Account extends Service {
|
|
|
846
1015
|
}, payload);
|
|
847
1016
|
}
|
|
848
1017
|
/**
|
|
849
|
-
*
|
|
1018
|
+
* 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.
|
|
850
1019
|
*
|
|
851
|
-
* @param {string} name
|
|
852
1020
|
* @throws {AppwriteException}
|
|
853
1021
|
* @returns {Promise}
|
|
854
1022
|
*/
|
|
855
|
-
|
|
1023
|
+
updateMFARecoveryCodes() {
|
|
1024
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
1025
|
+
const payload = {};
|
|
1026
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1027
|
+
return this.client.call('patch', uri, {
|
|
1028
|
+
'content-type': 'application/json',
|
|
1029
|
+
}, payload);
|
|
1030
|
+
}
|
|
1031
|
+
updateName(paramsOrFirst) {
|
|
1032
|
+
let params;
|
|
1033
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1034
|
+
params = (paramsOrFirst || {});
|
|
1035
|
+
}
|
|
1036
|
+
else {
|
|
1037
|
+
params = {
|
|
1038
|
+
name: paramsOrFirst
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
const name = params.name;
|
|
856
1042
|
if (typeof name === 'undefined') {
|
|
857
1043
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
858
1044
|
}
|
|
@@ -866,17 +1052,19 @@ class Account extends Service {
|
|
|
866
1052
|
'content-type': 'application/json',
|
|
867
1053
|
}, payload);
|
|
868
1054
|
}
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1055
|
+
updatePassword(paramsOrFirst, ...rest) {
|
|
1056
|
+
let params;
|
|
1057
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1058
|
+
params = (paramsOrFirst || {});
|
|
1059
|
+
}
|
|
1060
|
+
else {
|
|
1061
|
+
params = {
|
|
1062
|
+
password: paramsOrFirst,
|
|
1063
|
+
oldPassword: rest[0]
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
const password = params.password;
|
|
1067
|
+
const oldPassword = params.oldPassword;
|
|
880
1068
|
if (typeof password === 'undefined') {
|
|
881
1069
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
882
1070
|
}
|
|
@@ -893,19 +1081,19 @@ class Account extends Service {
|
|
|
893
1081
|
'content-type': 'application/json',
|
|
894
1082
|
}, payload);
|
|
895
1083
|
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1084
|
+
updatePhone(paramsOrFirst, ...rest) {
|
|
1085
|
+
let params;
|
|
1086
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1087
|
+
params = (paramsOrFirst || {});
|
|
1088
|
+
}
|
|
1089
|
+
else {
|
|
1090
|
+
params = {
|
|
1091
|
+
phone: paramsOrFirst,
|
|
1092
|
+
password: rest[0]
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
const phone = params.phone;
|
|
1096
|
+
const password = params.password;
|
|
909
1097
|
if (typeof phone === 'undefined') {
|
|
910
1098
|
throw new AppwriteException('Missing required parameter: "phone"');
|
|
911
1099
|
}
|
|
@@ -937,16 +1125,17 @@ class Account extends Service {
|
|
|
937
1125
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
938
1126
|
return this.client.call('get', uri, {}, payload);
|
|
939
1127
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1128
|
+
updatePrefs(paramsOrFirst) {
|
|
1129
|
+
let params;
|
|
1130
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'prefs' in paramsOrFirst)) {
|
|
1131
|
+
params = (paramsOrFirst || {});
|
|
1132
|
+
}
|
|
1133
|
+
else {
|
|
1134
|
+
params = {
|
|
1135
|
+
prefs: paramsOrFirst
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
const prefs = params.prefs;
|
|
950
1139
|
if (typeof prefs === 'undefined') {
|
|
951
1140
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
952
1141
|
}
|
|
@@ -960,22 +1149,19 @@ class Account extends Service {
|
|
|
960
1149
|
'content-type': 'application/json',
|
|
961
1150
|
}, payload);
|
|
962
1151
|
}
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
* @returns {Promise}
|
|
977
|
-
*/
|
|
978
|
-
createRecovery(email, url) {
|
|
1152
|
+
createRecovery(paramsOrFirst, ...rest) {
|
|
1153
|
+
let params;
|
|
1154
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1155
|
+
params = (paramsOrFirst || {});
|
|
1156
|
+
}
|
|
1157
|
+
else {
|
|
1158
|
+
params = {
|
|
1159
|
+
email: paramsOrFirst,
|
|
1160
|
+
url: rest[0]
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
const email = params.email;
|
|
1164
|
+
const url = params.url;
|
|
979
1165
|
if (typeof email === 'undefined') {
|
|
980
1166
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
981
1167
|
}
|
|
@@ -995,26 +1181,22 @@ class Account extends Service {
|
|
|
995
1181
|
'content-type': 'application/json',
|
|
996
1182
|
}, payload);
|
|
997
1183
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
* @returns {Promise}
|
|
1015
|
-
*/
|
|
1016
|
-
updateRecovery(userId, secret, password) {
|
|
1017
|
-
if (typeof userId === 'undefined') {
|
|
1184
|
+
updateRecovery(paramsOrFirst, ...rest) {
|
|
1185
|
+
let params;
|
|
1186
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1187
|
+
params = (paramsOrFirst || {});
|
|
1188
|
+
}
|
|
1189
|
+
else {
|
|
1190
|
+
params = {
|
|
1191
|
+
userId: paramsOrFirst,
|
|
1192
|
+
secret: rest[0],
|
|
1193
|
+
password: rest[1]
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
const userId = params.userId;
|
|
1197
|
+
const secret = params.secret;
|
|
1198
|
+
const password = params.password;
|
|
1199
|
+
if (typeof userId === 'undefined') {
|
|
1018
1200
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1019
1201
|
}
|
|
1020
1202
|
if (typeof secret === 'undefined') {
|
|
@@ -1040,8 +1222,7 @@ class Account extends Service {
|
|
|
1040
1222
|
}, payload);
|
|
1041
1223
|
}
|
|
1042
1224
|
/**
|
|
1043
|
-
* Get the list of active sessions across different devices for the currently
|
|
1044
|
-
* logged in user.
|
|
1225
|
+
* Get the list of active sessions across different devices for the currently logged in user.
|
|
1045
1226
|
*
|
|
1046
1227
|
* @throws {AppwriteException}
|
|
1047
1228
|
* @returns {Promise}
|
|
@@ -1053,8 +1234,7 @@ class Account extends Service {
|
|
|
1053
1234
|
return this.client.call('get', uri, {}, payload);
|
|
1054
1235
|
}
|
|
1055
1236
|
/**
|
|
1056
|
-
* Delete all sessions from the user account and remove any sessions cookies
|
|
1057
|
-
* from the end client.
|
|
1237
|
+
* Delete all sessions from the user account and remove any sessions cookies from the end client.
|
|
1058
1238
|
*
|
|
1059
1239
|
* @throws {AppwriteException}
|
|
1060
1240
|
* @returns {Promise}
|
|
@@ -1068,13 +1248,7 @@ class Account extends Service {
|
|
|
1068
1248
|
}, payload);
|
|
1069
1249
|
}
|
|
1070
1250
|
/**
|
|
1071
|
-
* Use this endpoint to allow a new user to register an anonymous account in
|
|
1072
|
-
* your project. This route will also create a new session for the user. To
|
|
1073
|
-
* allow the new user to convert an anonymous account to a normal account, you
|
|
1074
|
-
* need to update its [email and
|
|
1075
|
-
* password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail)
|
|
1076
|
-
* or create an [OAuth2
|
|
1077
|
-
* session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
|
|
1251
|
+
* 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).
|
|
1078
1252
|
*
|
|
1079
1253
|
* @throws {AppwriteException}
|
|
1080
1254
|
* @returns {Promise}
|
|
@@ -1087,20 +1261,19 @@ class Account extends Service {
|
|
|
1087
1261
|
'content-type': 'application/json',
|
|
1088
1262
|
}, payload);
|
|
1089
1263
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
createEmailPasswordSession(email, password) {
|
|
1264
|
+
createEmailPasswordSession(paramsOrFirst, ...rest) {
|
|
1265
|
+
let params;
|
|
1266
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1267
|
+
params = (paramsOrFirst || {});
|
|
1268
|
+
}
|
|
1269
|
+
else {
|
|
1270
|
+
params = {
|
|
1271
|
+
email: paramsOrFirst,
|
|
1272
|
+
password: rest[0]
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
const email = params.email;
|
|
1276
|
+
const password = params.password;
|
|
1104
1277
|
if (typeof email === 'undefined') {
|
|
1105
1278
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
1106
1279
|
}
|
|
@@ -1120,17 +1293,19 @@ class Account extends Service {
|
|
|
1120
1293
|
'content-type': 'application/json',
|
|
1121
1294
|
}, payload);
|
|
1122
1295
|
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1296
|
+
updateMagicURLSession(paramsOrFirst, ...rest) {
|
|
1297
|
+
let params;
|
|
1298
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1299
|
+
params = (paramsOrFirst || {});
|
|
1300
|
+
}
|
|
1301
|
+
else {
|
|
1302
|
+
params = {
|
|
1303
|
+
userId: paramsOrFirst,
|
|
1304
|
+
secret: rest[0]
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
const userId = params.userId;
|
|
1308
|
+
const secret = params.secret;
|
|
1134
1309
|
if (typeof userId === 'undefined') {
|
|
1135
1310
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1136
1311
|
}
|
|
@@ -1150,32 +1325,23 @@ class Account extends Service {
|
|
|
1150
1325
|
'content-type': 'application/json',
|
|
1151
1326
|
}, payload);
|
|
1152
1327
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
*
|
|
1171
|
-
* @param {OAuthProvider} provider
|
|
1172
|
-
* @param {string} success
|
|
1173
|
-
* @param {string} failure
|
|
1174
|
-
* @param {string[]} scopes
|
|
1175
|
-
* @throws {AppwriteException}
|
|
1176
|
-
* @returns {void|string}
|
|
1177
|
-
*/
|
|
1178
|
-
createOAuth2Session(provider, success, failure, scopes) {
|
|
1328
|
+
createOAuth2Session(paramsOrFirst, ...rest) {
|
|
1329
|
+
let params;
|
|
1330
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
1331
|
+
params = (paramsOrFirst || {});
|
|
1332
|
+
}
|
|
1333
|
+
else {
|
|
1334
|
+
params = {
|
|
1335
|
+
provider: paramsOrFirst,
|
|
1336
|
+
success: rest[0],
|
|
1337
|
+
failure: rest[1],
|
|
1338
|
+
scopes: rest[2]
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
const provider = params.provider;
|
|
1342
|
+
const success = params.success;
|
|
1343
|
+
const failure = params.failure;
|
|
1344
|
+
const scopes = params.scopes;
|
|
1179
1345
|
if (typeof provider === 'undefined') {
|
|
1180
1346
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
1181
1347
|
}
|
|
@@ -1197,17 +1363,19 @@ class Account extends Service {
|
|
|
1197
1363
|
}
|
|
1198
1364
|
return uri;
|
|
1199
1365
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1366
|
+
updatePhoneSession(paramsOrFirst, ...rest) {
|
|
1367
|
+
let params;
|
|
1368
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1369
|
+
params = (paramsOrFirst || {});
|
|
1370
|
+
}
|
|
1371
|
+
else {
|
|
1372
|
+
params = {
|
|
1373
|
+
userId: paramsOrFirst,
|
|
1374
|
+
secret: rest[0]
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
const userId = params.userId;
|
|
1378
|
+
const secret = params.secret;
|
|
1211
1379
|
if (typeof userId === 'undefined') {
|
|
1212
1380
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1213
1381
|
}
|
|
@@ -1227,17 +1395,19 @@ class Account extends Service {
|
|
|
1227
1395
|
'content-type': 'application/json',
|
|
1228
1396
|
}, payload);
|
|
1229
1397
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1398
|
+
createSession(paramsOrFirst, ...rest) {
|
|
1399
|
+
let params;
|
|
1400
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1401
|
+
params = (paramsOrFirst || {});
|
|
1402
|
+
}
|
|
1403
|
+
else {
|
|
1404
|
+
params = {
|
|
1405
|
+
userId: paramsOrFirst,
|
|
1406
|
+
secret: rest[0]
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
const userId = params.userId;
|
|
1410
|
+
const secret = params.secret;
|
|
1241
1411
|
if (typeof userId === 'undefined') {
|
|
1242
1412
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1243
1413
|
}
|
|
@@ -1257,15 +1427,17 @@ class Account extends Service {
|
|
|
1257
1427
|
'content-type': 'application/json',
|
|
1258
1428
|
}, payload);
|
|
1259
1429
|
}
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1430
|
+
getSession(paramsOrFirst) {
|
|
1431
|
+
let params;
|
|
1432
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1433
|
+
params = (paramsOrFirst || {});
|
|
1434
|
+
}
|
|
1435
|
+
else {
|
|
1436
|
+
params = {
|
|
1437
|
+
sessionId: paramsOrFirst
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1440
|
+
const sessionId = params.sessionId;
|
|
1269
1441
|
if (typeof sessionId === 'undefined') {
|
|
1270
1442
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1271
1443
|
}
|
|
@@ -1274,16 +1446,17 @@ class Account extends Service {
|
|
|
1274
1446
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1275
1447
|
return this.client.call('get', uri, {}, payload);
|
|
1276
1448
|
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1449
|
+
updateSession(paramsOrFirst) {
|
|
1450
|
+
let params;
|
|
1451
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1452
|
+
params = (paramsOrFirst || {});
|
|
1453
|
+
}
|
|
1454
|
+
else {
|
|
1455
|
+
params = {
|
|
1456
|
+
sessionId: paramsOrFirst
|
|
1457
|
+
};
|
|
1458
|
+
}
|
|
1459
|
+
const sessionId = params.sessionId;
|
|
1287
1460
|
if (typeof sessionId === 'undefined') {
|
|
1288
1461
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1289
1462
|
}
|
|
@@ -1294,18 +1467,17 @@ class Account extends Service {
|
|
|
1294
1467
|
'content-type': 'application/json',
|
|
1295
1468
|
}, payload);
|
|
1296
1469
|
}
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
deleteSession(sessionId) {
|
|
1470
|
+
deleteSession(paramsOrFirst) {
|
|
1471
|
+
let params;
|
|
1472
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1473
|
+
params = (paramsOrFirst || {});
|
|
1474
|
+
}
|
|
1475
|
+
else {
|
|
1476
|
+
params = {
|
|
1477
|
+
sessionId: paramsOrFirst
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
const sessionId = params.sessionId;
|
|
1309
1481
|
if (typeof sessionId === 'undefined') {
|
|
1310
1482
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1311
1483
|
}
|
|
@@ -1317,9 +1489,7 @@ class Account extends Service {
|
|
|
1317
1489
|
}, payload);
|
|
1318
1490
|
}
|
|
1319
1491
|
/**
|
|
1320
|
-
* Block the currently logged in user account. Behind the scene, the user
|
|
1321
|
-
* record is not deleted but permanently blocked from any access. To
|
|
1322
|
-
* completely delete a user, use the Users API instead.
|
|
1492
|
+
* 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.
|
|
1323
1493
|
*
|
|
1324
1494
|
* @throws {AppwriteException}
|
|
1325
1495
|
* @returns {Promise}
|
|
@@ -1332,20 +1502,21 @@ class Account extends Service {
|
|
|
1332
1502
|
'content-type': 'application/json',
|
|
1333
1503
|
}, payload);
|
|
1334
1504
|
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1505
|
+
createPushTarget(paramsOrFirst, ...rest) {
|
|
1506
|
+
let params;
|
|
1507
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1508
|
+
params = (paramsOrFirst || {});
|
|
1509
|
+
}
|
|
1510
|
+
else {
|
|
1511
|
+
params = {
|
|
1512
|
+
targetId: paramsOrFirst,
|
|
1513
|
+
identifier: rest[0],
|
|
1514
|
+
providerId: rest[1]
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
const targetId = params.targetId;
|
|
1518
|
+
const identifier = params.identifier;
|
|
1519
|
+
const providerId = params.providerId;
|
|
1349
1520
|
if (typeof targetId === 'undefined') {
|
|
1350
1521
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1351
1522
|
}
|
|
@@ -1368,19 +1539,19 @@ class Account extends Service {
|
|
|
1368
1539
|
'content-type': 'application/json',
|
|
1369
1540
|
}, payload);
|
|
1370
1541
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1542
|
+
updatePushTarget(paramsOrFirst, ...rest) {
|
|
1543
|
+
let params;
|
|
1544
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1545
|
+
params = (paramsOrFirst || {});
|
|
1546
|
+
}
|
|
1547
|
+
else {
|
|
1548
|
+
params = {
|
|
1549
|
+
targetId: paramsOrFirst,
|
|
1550
|
+
identifier: rest[0]
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
const targetId = params.targetId;
|
|
1554
|
+
const identifier = params.identifier;
|
|
1384
1555
|
if (typeof targetId === 'undefined') {
|
|
1385
1556
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1386
1557
|
}
|
|
@@ -1397,16 +1568,17 @@ class Account extends Service {
|
|
|
1397
1568
|
'content-type': 'application/json',
|
|
1398
1569
|
}, payload);
|
|
1399
1570
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1571
|
+
deletePushTarget(paramsOrFirst) {
|
|
1572
|
+
let params;
|
|
1573
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1574
|
+
params = (paramsOrFirst || {});
|
|
1575
|
+
}
|
|
1576
|
+
else {
|
|
1577
|
+
params = {
|
|
1578
|
+
targetId: paramsOrFirst
|
|
1579
|
+
};
|
|
1580
|
+
}
|
|
1581
|
+
const targetId = params.targetId;
|
|
1410
1582
|
if (typeof targetId === 'undefined') {
|
|
1411
1583
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1412
1584
|
}
|
|
@@ -1417,25 +1589,21 @@ class Account extends Service {
|
|
|
1417
1589
|
'content-type': 'application/json',
|
|
1418
1590
|
}, payload);
|
|
1419
1591
|
}
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
* @throws {AppwriteException}
|
|
1436
|
-
* @returns {Promise}
|
|
1437
|
-
*/
|
|
1438
|
-
createEmailToken(userId, email, phrase) {
|
|
1592
|
+
createEmailToken(paramsOrFirst, ...rest) {
|
|
1593
|
+
let params;
|
|
1594
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1595
|
+
params = (paramsOrFirst || {});
|
|
1596
|
+
}
|
|
1597
|
+
else {
|
|
1598
|
+
params = {
|
|
1599
|
+
userId: paramsOrFirst,
|
|
1600
|
+
email: rest[0],
|
|
1601
|
+
phrase: rest[1]
|
|
1602
|
+
};
|
|
1603
|
+
}
|
|
1604
|
+
const userId = params.userId;
|
|
1605
|
+
const email = params.email;
|
|
1606
|
+
const phrase = params.phrase;
|
|
1439
1607
|
if (typeof userId === 'undefined') {
|
|
1440
1608
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1441
1609
|
}
|
|
@@ -1458,30 +1626,23 @@ class Account extends Service {
|
|
|
1458
1626
|
'content-type': 'application/json',
|
|
1459
1627
|
}, payload);
|
|
1460
1628
|
}
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
* @param {string} email
|
|
1479
|
-
* @param {string} url
|
|
1480
|
-
* @param {boolean} phrase
|
|
1481
|
-
* @throws {AppwriteException}
|
|
1482
|
-
* @returns {Promise}
|
|
1483
|
-
*/
|
|
1484
|
-
createMagicURLToken(userId, email, url, phrase) {
|
|
1629
|
+
createMagicURLToken(paramsOrFirst, ...rest) {
|
|
1630
|
+
let params;
|
|
1631
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1632
|
+
params = (paramsOrFirst || {});
|
|
1633
|
+
}
|
|
1634
|
+
else {
|
|
1635
|
+
params = {
|
|
1636
|
+
userId: paramsOrFirst,
|
|
1637
|
+
email: rest[0],
|
|
1638
|
+
url: rest[1],
|
|
1639
|
+
phrase: rest[2]
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
const userId = params.userId;
|
|
1643
|
+
const email = params.email;
|
|
1644
|
+
const url = params.url;
|
|
1645
|
+
const phrase = params.phrase;
|
|
1485
1646
|
if (typeof userId === 'undefined') {
|
|
1486
1647
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1487
1648
|
}
|
|
@@ -1507,30 +1668,23 @@ class Account extends Service {
|
|
|
1507
1668
|
'content-type': 'application/json',
|
|
1508
1669
|
}, payload);
|
|
1509
1670
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
* @param {string} success
|
|
1528
|
-
* @param {string} failure
|
|
1529
|
-
* @param {string[]} scopes
|
|
1530
|
-
* @throws {AppwriteException}
|
|
1531
|
-
* @returns {void|string}
|
|
1532
|
-
*/
|
|
1533
|
-
createOAuth2Token(provider, success, failure, scopes) {
|
|
1671
|
+
createOAuth2Token(paramsOrFirst, ...rest) {
|
|
1672
|
+
let params;
|
|
1673
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
1674
|
+
params = (paramsOrFirst || {});
|
|
1675
|
+
}
|
|
1676
|
+
else {
|
|
1677
|
+
params = {
|
|
1678
|
+
provider: paramsOrFirst,
|
|
1679
|
+
success: rest[0],
|
|
1680
|
+
failure: rest[1],
|
|
1681
|
+
scopes: rest[2]
|
|
1682
|
+
};
|
|
1683
|
+
}
|
|
1684
|
+
const provider = params.provider;
|
|
1685
|
+
const success = params.success;
|
|
1686
|
+
const failure = params.failure;
|
|
1687
|
+
const scopes = params.scopes;
|
|
1534
1688
|
if (typeof provider === 'undefined') {
|
|
1535
1689
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
1536
1690
|
}
|
|
@@ -1552,24 +1706,19 @@ class Account extends Service {
|
|
|
1552
1706
|
}
|
|
1553
1707
|
return uri;
|
|
1554
1708
|
}
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
* @param {string} phone
|
|
1569
|
-
* @throws {AppwriteException}
|
|
1570
|
-
* @returns {Promise}
|
|
1571
|
-
*/
|
|
1572
|
-
createPhoneToken(userId, phone) {
|
|
1709
|
+
createPhoneToken(paramsOrFirst, ...rest) {
|
|
1710
|
+
let params;
|
|
1711
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1712
|
+
params = (paramsOrFirst || {});
|
|
1713
|
+
}
|
|
1714
|
+
else {
|
|
1715
|
+
params = {
|
|
1716
|
+
userId: paramsOrFirst,
|
|
1717
|
+
phone: rest[0]
|
|
1718
|
+
};
|
|
1719
|
+
}
|
|
1720
|
+
const userId = params.userId;
|
|
1721
|
+
const phone = params.phone;
|
|
1573
1722
|
if (typeof userId === 'undefined') {
|
|
1574
1723
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1575
1724
|
}
|
|
@@ -1589,28 +1738,17 @@ class Account extends Service {
|
|
|
1589
1738
|
'content-type': 'application/json',
|
|
1590
1739
|
}, payload);
|
|
1591
1740
|
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
* Please note that in order to avoid a [Redirect
|
|
1604
|
-
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
|
|
1605
|
-
* the only valid redirect URLs are the ones from domains you have set when
|
|
1606
|
-
* adding your platforms in the console interface.
|
|
1607
|
-
*
|
|
1608
|
-
*
|
|
1609
|
-
* @param {string} url
|
|
1610
|
-
* @throws {AppwriteException}
|
|
1611
|
-
* @returns {Promise}
|
|
1612
|
-
*/
|
|
1613
|
-
createVerification(url) {
|
|
1741
|
+
createVerification(paramsOrFirst) {
|
|
1742
|
+
let params;
|
|
1743
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1744
|
+
params = (paramsOrFirst || {});
|
|
1745
|
+
}
|
|
1746
|
+
else {
|
|
1747
|
+
params = {
|
|
1748
|
+
url: paramsOrFirst
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
const url = params.url;
|
|
1614
1752
|
if (typeof url === 'undefined') {
|
|
1615
1753
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
1616
1754
|
}
|
|
@@ -1624,18 +1762,19 @@ class Account extends Service {
|
|
|
1624
1762
|
'content-type': 'application/json',
|
|
1625
1763
|
}, payload);
|
|
1626
1764
|
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1765
|
+
updateVerification(paramsOrFirst, ...rest) {
|
|
1766
|
+
let params;
|
|
1767
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1768
|
+
params = (paramsOrFirst || {});
|
|
1769
|
+
}
|
|
1770
|
+
else {
|
|
1771
|
+
params = {
|
|
1772
|
+
userId: paramsOrFirst,
|
|
1773
|
+
secret: rest[0]
|
|
1774
|
+
};
|
|
1775
|
+
}
|
|
1776
|
+
const userId = params.userId;
|
|
1777
|
+
const secret = params.secret;
|
|
1639
1778
|
if (typeof userId === 'undefined') {
|
|
1640
1779
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1641
1780
|
}
|
|
@@ -1656,14 +1795,7 @@ class Account extends Service {
|
|
|
1656
1795
|
}, payload);
|
|
1657
1796
|
}
|
|
1658
1797
|
/**
|
|
1659
|
-
* Use this endpoint to send a verification SMS to the currently logged in
|
|
1660
|
-
* user. This endpoint is meant for use after updating a user's phone number
|
|
1661
|
-
* using the
|
|
1662
|
-
* [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone)
|
|
1663
|
-
* endpoint. Learn more about how to [complete the verification
|
|
1664
|
-
* process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification).
|
|
1665
|
-
* The verification code sent to the user's phone number is valid for 15
|
|
1666
|
-
* minutes.
|
|
1798
|
+
* 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.
|
|
1667
1799
|
*
|
|
1668
1800
|
* @throws {AppwriteException}
|
|
1669
1801
|
* @returns {Promise}
|
|
@@ -1676,18 +1808,19 @@ class Account extends Service {
|
|
|
1676
1808
|
'content-type': 'application/json',
|
|
1677
1809
|
}, payload);
|
|
1678
1810
|
}
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1811
|
+
updatePhoneVerification(paramsOrFirst, ...rest) {
|
|
1812
|
+
let params;
|
|
1813
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1814
|
+
params = (paramsOrFirst || {});
|
|
1815
|
+
}
|
|
1816
|
+
else {
|
|
1817
|
+
params = {
|
|
1818
|
+
userId: paramsOrFirst,
|
|
1819
|
+
secret: rest[0]
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
const userId = params.userId;
|
|
1823
|
+
const secret = params.secret;
|
|
1691
1824
|
if (typeof userId === 'undefined') {
|
|
1692
1825
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1693
1826
|
}
|
|
@@ -1713,26 +1846,23 @@ class Avatars extends Service {
|
|
|
1713
1846
|
constructor(client) {
|
|
1714
1847
|
super(client);
|
|
1715
1848
|
}
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
* @returns {ArrayBuffer}
|
|
1734
|
-
*/
|
|
1735
|
-
getBrowser(code, width, height, quality) {
|
|
1849
|
+
getBrowser(paramsOrFirst, ...rest) {
|
|
1850
|
+
let params;
|
|
1851
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
1852
|
+
params = (paramsOrFirst || {});
|
|
1853
|
+
}
|
|
1854
|
+
else {
|
|
1855
|
+
params = {
|
|
1856
|
+
code: paramsOrFirst,
|
|
1857
|
+
width: rest[0],
|
|
1858
|
+
height: rest[1],
|
|
1859
|
+
quality: rest[2]
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1862
|
+
const code = params.code;
|
|
1863
|
+
const width = params.width;
|
|
1864
|
+
const height = params.height;
|
|
1865
|
+
const quality = params.quality;
|
|
1736
1866
|
if (typeof code === 'undefined') {
|
|
1737
1867
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
1738
1868
|
}
|
|
@@ -1754,25 +1884,23 @@ class Avatars extends Service {
|
|
|
1754
1884
|
}
|
|
1755
1885
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1756
1886
|
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
*/
|
|
1775
|
-
getCreditCard(code, width, height, quality) {
|
|
1887
|
+
getCreditCard(paramsOrFirst, ...rest) {
|
|
1888
|
+
let params;
|
|
1889
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
1890
|
+
params = (paramsOrFirst || {});
|
|
1891
|
+
}
|
|
1892
|
+
else {
|
|
1893
|
+
params = {
|
|
1894
|
+
code: paramsOrFirst,
|
|
1895
|
+
width: rest[0],
|
|
1896
|
+
height: rest[1],
|
|
1897
|
+
quality: rest[2]
|
|
1898
|
+
};
|
|
1899
|
+
}
|
|
1900
|
+
const code = params.code;
|
|
1901
|
+
const width = params.width;
|
|
1902
|
+
const height = params.height;
|
|
1903
|
+
const quality = params.quality;
|
|
1776
1904
|
if (typeof code === 'undefined') {
|
|
1777
1905
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
1778
1906
|
}
|
|
@@ -1794,17 +1922,17 @@ class Avatars extends Service {
|
|
|
1794
1922
|
}
|
|
1795
1923
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1796
1924
|
}
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1925
|
+
getFavicon(paramsOrFirst) {
|
|
1926
|
+
let params;
|
|
1927
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1928
|
+
params = (paramsOrFirst || {});
|
|
1929
|
+
}
|
|
1930
|
+
else {
|
|
1931
|
+
params = {
|
|
1932
|
+
url: paramsOrFirst
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
const url = params.url;
|
|
1808
1936
|
if (typeof url === 'undefined') {
|
|
1809
1937
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
1810
1938
|
}
|
|
@@ -1820,26 +1948,23 @@ class Avatars extends Service {
|
|
|
1820
1948
|
}
|
|
1821
1949
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1822
1950
|
}
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
* @returns {ArrayBuffer}
|
|
1841
|
-
*/
|
|
1842
|
-
getFlag(code, width, height, quality) {
|
|
1951
|
+
getFlag(paramsOrFirst, ...rest) {
|
|
1952
|
+
let params;
|
|
1953
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
1954
|
+
params = (paramsOrFirst || {});
|
|
1955
|
+
}
|
|
1956
|
+
else {
|
|
1957
|
+
params = {
|
|
1958
|
+
code: paramsOrFirst,
|
|
1959
|
+
width: rest[0],
|
|
1960
|
+
height: rest[1],
|
|
1961
|
+
quality: rest[2]
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
const code = params.code;
|
|
1965
|
+
const width = params.width;
|
|
1966
|
+
const height = params.height;
|
|
1967
|
+
const quality = params.quality;
|
|
1843
1968
|
if (typeof code === 'undefined') {
|
|
1844
1969
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
1845
1970
|
}
|
|
@@ -1861,26 +1986,21 @@ class Avatars extends Service {
|
|
|
1861
1986
|
}
|
|
1862
1987
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1863
1988
|
}
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
* @param {number} height
|
|
1880
|
-
* @throws {AppwriteException}
|
|
1881
|
-
* @returns {ArrayBuffer}
|
|
1882
|
-
*/
|
|
1883
|
-
getImage(url, width, height) {
|
|
1989
|
+
getImage(paramsOrFirst, ...rest) {
|
|
1990
|
+
let params;
|
|
1991
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1992
|
+
params = (paramsOrFirst || {});
|
|
1993
|
+
}
|
|
1994
|
+
else {
|
|
1995
|
+
params = {
|
|
1996
|
+
url: paramsOrFirst,
|
|
1997
|
+
width: rest[0],
|
|
1998
|
+
height: rest[1]
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
2001
|
+
const url = params.url;
|
|
2002
|
+
const width = params.width;
|
|
2003
|
+
const height = params.height;
|
|
1884
2004
|
if (typeof url === 'undefined') {
|
|
1885
2005
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
1886
2006
|
}
|
|
@@ -1902,32 +2022,23 @@ class Avatars extends Service {
|
|
|
1902
2022
|
}
|
|
1903
2023
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1904
2024
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
*
|
|
1923
|
-
* @param {string} name
|
|
1924
|
-
* @param {number} width
|
|
1925
|
-
* @param {number} height
|
|
1926
|
-
* @param {string} background
|
|
1927
|
-
* @throws {AppwriteException}
|
|
1928
|
-
* @returns {ArrayBuffer}
|
|
1929
|
-
*/
|
|
1930
|
-
getInitials(name, width, height, background) {
|
|
2025
|
+
getInitials(paramsOrFirst, ...rest) {
|
|
2026
|
+
let params;
|
|
2027
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2028
|
+
params = (paramsOrFirst || {});
|
|
2029
|
+
}
|
|
2030
|
+
else {
|
|
2031
|
+
params = {
|
|
2032
|
+
name: paramsOrFirst,
|
|
2033
|
+
width: rest[0],
|
|
2034
|
+
height: rest[1],
|
|
2035
|
+
background: rest[2]
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
const name = params.name;
|
|
2039
|
+
const width = params.width;
|
|
2040
|
+
const height = params.height;
|
|
2041
|
+
const background = params.background;
|
|
1931
2042
|
const apiPath = '/avatars/initials';
|
|
1932
2043
|
const payload = {};
|
|
1933
2044
|
if (typeof name !== 'undefined') {
|
|
@@ -1949,19 +2060,23 @@ class Avatars extends Service {
|
|
|
1949
2060
|
}
|
|
1950
2061
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
1951
2062
|
}
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2063
|
+
getQR(paramsOrFirst, ...rest) {
|
|
2064
|
+
let params;
|
|
2065
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2066
|
+
params = (paramsOrFirst || {});
|
|
2067
|
+
}
|
|
2068
|
+
else {
|
|
2069
|
+
params = {
|
|
2070
|
+
text: paramsOrFirst,
|
|
2071
|
+
size: rest[0],
|
|
2072
|
+
margin: rest[1],
|
|
2073
|
+
download: rest[2]
|
|
2074
|
+
};
|
|
2075
|
+
}
|
|
2076
|
+
const text = params.text;
|
|
2077
|
+
const size = params.size;
|
|
2078
|
+
const margin = params.margin;
|
|
2079
|
+
const download = params.download;
|
|
1965
2080
|
if (typeof text === 'undefined') {
|
|
1966
2081
|
throw new AppwriteException('Missing required parameter: "text"');
|
|
1967
2082
|
}
|
|
@@ -2247,17 +2362,21 @@ class Databases extends Service {
|
|
|
2247
2362
|
constructor(client) {
|
|
2248
2363
|
super(client);
|
|
2249
2364
|
}
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2365
|
+
listDocuments(paramsOrFirst, ...rest) {
|
|
2366
|
+
let params;
|
|
2367
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2368
|
+
params = (paramsOrFirst || {});
|
|
2369
|
+
}
|
|
2370
|
+
else {
|
|
2371
|
+
params = {
|
|
2372
|
+
databaseId: paramsOrFirst,
|
|
2373
|
+
collectionId: rest[0],
|
|
2374
|
+
queries: rest[1]
|
|
2375
|
+
};
|
|
2376
|
+
}
|
|
2377
|
+
const databaseId = params.databaseId;
|
|
2378
|
+
const collectionId = params.collectionId;
|
|
2379
|
+
const queries = params.queries;
|
|
2261
2380
|
if (typeof databaseId === 'undefined') {
|
|
2262
2381
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2263
2382
|
}
|
|
@@ -2272,21 +2391,25 @@ class Databases extends Service {
|
|
|
2272
2391
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2273
2392
|
return this.client.call('get', uri, {}, payload);
|
|
2274
2393
|
}
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2394
|
+
createDocument(paramsOrFirst, ...rest) {
|
|
2395
|
+
let params;
|
|
2396
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2397
|
+
params = (paramsOrFirst || {});
|
|
2398
|
+
}
|
|
2399
|
+
else {
|
|
2400
|
+
params = {
|
|
2401
|
+
databaseId: paramsOrFirst,
|
|
2402
|
+
collectionId: rest[0],
|
|
2403
|
+
documentId: rest[1],
|
|
2404
|
+
data: rest[2],
|
|
2405
|
+
permissions: rest[3]
|
|
2406
|
+
};
|
|
2407
|
+
}
|
|
2408
|
+
const databaseId = params.databaseId;
|
|
2409
|
+
const collectionId = params.collectionId;
|
|
2410
|
+
const documentId = params.documentId;
|
|
2411
|
+
const data = params.data;
|
|
2412
|
+
const permissions = params.permissions;
|
|
2290
2413
|
if (typeof databaseId === 'undefined') {
|
|
2291
2414
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2292
2415
|
}
|
|
@@ -2315,18 +2438,23 @@ class Databases extends Service {
|
|
|
2315
2438
|
'content-type': 'application/json',
|
|
2316
2439
|
}, payload);
|
|
2317
2440
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2441
|
+
getDocument(paramsOrFirst, ...rest) {
|
|
2442
|
+
let params;
|
|
2443
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2444
|
+
params = (paramsOrFirst || {});
|
|
2445
|
+
}
|
|
2446
|
+
else {
|
|
2447
|
+
params = {
|
|
2448
|
+
databaseId: paramsOrFirst,
|
|
2449
|
+
collectionId: rest[0],
|
|
2450
|
+
documentId: rest[1],
|
|
2451
|
+
queries: rest[2]
|
|
2452
|
+
};
|
|
2453
|
+
}
|
|
2454
|
+
const databaseId = params.databaseId;
|
|
2455
|
+
const collectionId = params.collectionId;
|
|
2456
|
+
const documentId = params.documentId;
|
|
2457
|
+
const queries = params.queries;
|
|
2330
2458
|
if (typeof databaseId === 'undefined') {
|
|
2331
2459
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2332
2460
|
}
|
|
@@ -2344,25 +2472,25 @@ class Databases extends Service {
|
|
|
2344
2472
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2345
2473
|
return this.client.call('get', uri, {}, payload);
|
|
2346
2474
|
}
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2475
|
+
upsertDocument(paramsOrFirst, ...rest) {
|
|
2476
|
+
let params;
|
|
2477
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2478
|
+
params = (paramsOrFirst || {});
|
|
2479
|
+
}
|
|
2480
|
+
else {
|
|
2481
|
+
params = {
|
|
2482
|
+
databaseId: paramsOrFirst,
|
|
2483
|
+
collectionId: rest[0],
|
|
2484
|
+
documentId: rest[1],
|
|
2485
|
+
data: rest[2],
|
|
2486
|
+
permissions: rest[3]
|
|
2487
|
+
};
|
|
2488
|
+
}
|
|
2489
|
+
const databaseId = params.databaseId;
|
|
2490
|
+
const collectionId = params.collectionId;
|
|
2491
|
+
const documentId = params.documentId;
|
|
2492
|
+
const data = params.data;
|
|
2493
|
+
const permissions = params.permissions;
|
|
2366
2494
|
if (typeof databaseId === 'undefined') {
|
|
2367
2495
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2368
2496
|
}
|
|
@@ -2388,19 +2516,25 @@ class Databases extends Service {
|
|
|
2388
2516
|
'content-type': 'application/json',
|
|
2389
2517
|
}, payload);
|
|
2390
2518
|
}
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2519
|
+
updateDocument(paramsOrFirst, ...rest) {
|
|
2520
|
+
let params;
|
|
2521
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2522
|
+
params = (paramsOrFirst || {});
|
|
2523
|
+
}
|
|
2524
|
+
else {
|
|
2525
|
+
params = {
|
|
2526
|
+
databaseId: paramsOrFirst,
|
|
2527
|
+
collectionId: rest[0],
|
|
2528
|
+
documentId: rest[1],
|
|
2529
|
+
data: rest[2],
|
|
2530
|
+
permissions: rest[3]
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
const databaseId = params.databaseId;
|
|
2534
|
+
const collectionId = params.collectionId;
|
|
2535
|
+
const documentId = params.documentId;
|
|
2536
|
+
const data = params.data;
|
|
2537
|
+
const permissions = params.permissions;
|
|
2404
2538
|
if (typeof databaseId === 'undefined') {
|
|
2405
2539
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2406
2540
|
}
|
|
@@ -2423,16 +2557,21 @@ class Databases extends Service {
|
|
|
2423
2557
|
'content-type': 'application/json',
|
|
2424
2558
|
}, payload);
|
|
2425
2559
|
}
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2560
|
+
deleteDocument(paramsOrFirst, ...rest) {
|
|
2561
|
+
let params;
|
|
2562
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2563
|
+
params = (paramsOrFirst || {});
|
|
2564
|
+
}
|
|
2565
|
+
else {
|
|
2566
|
+
params = {
|
|
2567
|
+
databaseId: paramsOrFirst,
|
|
2568
|
+
collectionId: rest[0],
|
|
2569
|
+
documentId: rest[1]
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
const databaseId = params.databaseId;
|
|
2573
|
+
const collectionId = params.collectionId;
|
|
2574
|
+
const documentId = params.documentId;
|
|
2436
2575
|
if (typeof databaseId === 'undefined') {
|
|
2437
2576
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2438
2577
|
}
|
|
@@ -2449,19 +2588,27 @@ class Databases extends Service {
|
|
|
2449
2588
|
'content-type': 'application/json',
|
|
2450
2589
|
}, payload);
|
|
2451
2590
|
}
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2591
|
+
decrementDocumentAttribute(paramsOrFirst, ...rest) {
|
|
2592
|
+
let params;
|
|
2593
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2594
|
+
params = (paramsOrFirst || {});
|
|
2595
|
+
}
|
|
2596
|
+
else {
|
|
2597
|
+
params = {
|
|
2598
|
+
databaseId: paramsOrFirst,
|
|
2599
|
+
collectionId: rest[0],
|
|
2600
|
+
documentId: rest[1],
|
|
2601
|
+
attribute: rest[2],
|
|
2602
|
+
value: rest[3],
|
|
2603
|
+
min: rest[4]
|
|
2604
|
+
};
|
|
2605
|
+
}
|
|
2606
|
+
const databaseId = params.databaseId;
|
|
2607
|
+
const collectionId = params.collectionId;
|
|
2608
|
+
const documentId = params.documentId;
|
|
2609
|
+
const attribute = params.attribute;
|
|
2610
|
+
const value = params.value;
|
|
2611
|
+
const min = params.min;
|
|
2465
2612
|
if (typeof databaseId === 'undefined') {
|
|
2466
2613
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2467
2614
|
}
|
|
@@ -2487,19 +2634,27 @@ class Databases extends Service {
|
|
|
2487
2634
|
'content-type': 'application/json',
|
|
2488
2635
|
}, payload);
|
|
2489
2636
|
}
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2637
|
+
incrementDocumentAttribute(paramsOrFirst, ...rest) {
|
|
2638
|
+
let params;
|
|
2639
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2640
|
+
params = (paramsOrFirst || {});
|
|
2641
|
+
}
|
|
2642
|
+
else {
|
|
2643
|
+
params = {
|
|
2644
|
+
databaseId: paramsOrFirst,
|
|
2645
|
+
collectionId: rest[0],
|
|
2646
|
+
documentId: rest[1],
|
|
2647
|
+
attribute: rest[2],
|
|
2648
|
+
value: rest[3],
|
|
2649
|
+
max: rest[4]
|
|
2650
|
+
};
|
|
2651
|
+
}
|
|
2652
|
+
const databaseId = params.databaseId;
|
|
2653
|
+
const collectionId = params.collectionId;
|
|
2654
|
+
const documentId = params.documentId;
|
|
2655
|
+
const attribute = params.attribute;
|
|
2656
|
+
const value = params.value;
|
|
2657
|
+
const max = params.max;
|
|
2503
2658
|
if (typeof databaseId === 'undefined') {
|
|
2504
2659
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2505
2660
|
}
|
|
@@ -2531,16 +2686,19 @@ class Functions extends Service {
|
|
|
2531
2686
|
constructor(client) {
|
|
2532
2687
|
super(client);
|
|
2533
2688
|
}
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2689
|
+
listExecutions(paramsOrFirst, ...rest) {
|
|
2690
|
+
let params;
|
|
2691
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2692
|
+
params = (paramsOrFirst || {});
|
|
2693
|
+
}
|
|
2694
|
+
else {
|
|
2695
|
+
params = {
|
|
2696
|
+
functionId: paramsOrFirst,
|
|
2697
|
+
queries: rest[0]
|
|
2698
|
+
};
|
|
2699
|
+
}
|
|
2700
|
+
const functionId = params.functionId;
|
|
2701
|
+
const queries = params.queries;
|
|
2544
2702
|
if (typeof functionId === 'undefined') {
|
|
2545
2703
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
2546
2704
|
}
|
|
@@ -2552,23 +2710,29 @@ class Functions extends Service {
|
|
|
2552
2710
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2553
2711
|
return this.client.call('get', uri, {}, payload);
|
|
2554
2712
|
}
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2713
|
+
createExecution(paramsOrFirst, ...rest) {
|
|
2714
|
+
let params;
|
|
2715
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2716
|
+
params = (paramsOrFirst || {});
|
|
2717
|
+
}
|
|
2718
|
+
else {
|
|
2719
|
+
params = {
|
|
2720
|
+
functionId: paramsOrFirst,
|
|
2721
|
+
body: rest[0],
|
|
2722
|
+
async: rest[1],
|
|
2723
|
+
xpath: rest[2],
|
|
2724
|
+
method: rest[3],
|
|
2725
|
+
headers: rest[4],
|
|
2726
|
+
scheduledAt: rest[5]
|
|
2727
|
+
};
|
|
2728
|
+
}
|
|
2729
|
+
const functionId = params.functionId;
|
|
2730
|
+
const body = params.body;
|
|
2731
|
+
const async = params.async;
|
|
2732
|
+
const xpath = params.xpath;
|
|
2733
|
+
const method = params.method;
|
|
2734
|
+
const headers = params.headers;
|
|
2735
|
+
const scheduledAt = params.scheduledAt;
|
|
2572
2736
|
if (typeof functionId === 'undefined') {
|
|
2573
2737
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
2574
2738
|
}
|
|
@@ -2597,15 +2761,19 @@ class Functions extends Service {
|
|
|
2597
2761
|
'content-type': 'application/json',
|
|
2598
2762
|
}, payload);
|
|
2599
2763
|
}
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2764
|
+
getExecution(paramsOrFirst, ...rest) {
|
|
2765
|
+
let params;
|
|
2766
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2767
|
+
params = (paramsOrFirst || {});
|
|
2768
|
+
}
|
|
2769
|
+
else {
|
|
2770
|
+
params = {
|
|
2771
|
+
functionId: paramsOrFirst,
|
|
2772
|
+
executionId: rest[0]
|
|
2773
|
+
};
|
|
2774
|
+
}
|
|
2775
|
+
const functionId = params.functionId;
|
|
2776
|
+
const executionId = params.executionId;
|
|
2609
2777
|
if (typeof functionId === 'undefined') {
|
|
2610
2778
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
2611
2779
|
}
|
|
@@ -2623,14 +2791,17 @@ class Graphql extends Service {
|
|
|
2623
2791
|
constructor(client) {
|
|
2624
2792
|
super(client);
|
|
2625
2793
|
}
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2794
|
+
query(paramsOrFirst) {
|
|
2795
|
+
let params;
|
|
2796
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
2797
|
+
params = (paramsOrFirst || {});
|
|
2798
|
+
}
|
|
2799
|
+
else {
|
|
2800
|
+
params = {
|
|
2801
|
+
query: paramsOrFirst
|
|
2802
|
+
};
|
|
2803
|
+
}
|
|
2804
|
+
const query = params.query;
|
|
2634
2805
|
if (typeof query === 'undefined') {
|
|
2635
2806
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
2636
2807
|
}
|
|
@@ -2645,14 +2816,17 @@ class Graphql extends Service {
|
|
|
2645
2816
|
'content-type': 'application/json',
|
|
2646
2817
|
}, payload);
|
|
2647
2818
|
}
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2819
|
+
mutation(paramsOrFirst) {
|
|
2820
|
+
let params;
|
|
2821
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
2822
|
+
params = (paramsOrFirst || {});
|
|
2823
|
+
}
|
|
2824
|
+
else {
|
|
2825
|
+
params = {
|
|
2826
|
+
query: paramsOrFirst
|
|
2827
|
+
};
|
|
2828
|
+
}
|
|
2829
|
+
const query = params.query;
|
|
2656
2830
|
if (typeof query === 'undefined') {
|
|
2657
2831
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
2658
2832
|
}
|
|
@@ -2674,10 +2848,7 @@ class Locale extends Service {
|
|
|
2674
2848
|
super(client);
|
|
2675
2849
|
}
|
|
2676
2850
|
/**
|
|
2677
|
-
* Get the current user location based on IP. Returns an object with user
|
|
2678
|
-
* country code, country name, continent name, continent code, ip address and
|
|
2679
|
-
* suggested currency. You can use the locale header to get the data in a
|
|
2680
|
-
* supported language.
|
|
2851
|
+
* 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.
|
|
2681
2852
|
*
|
|
2682
2853
|
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
|
2683
2854
|
*
|
|
@@ -2691,8 +2862,7 @@ class Locale extends Service {
|
|
|
2691
2862
|
return this.client.call('get', uri, {}, payload);
|
|
2692
2863
|
}
|
|
2693
2864
|
/**
|
|
2694
|
-
* List of all locale codes in [ISO
|
|
2695
|
-
* 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
2865
|
+
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
2696
2866
|
*
|
|
2697
2867
|
* @throws {AppwriteException}
|
|
2698
2868
|
* @returns {Promise}
|
|
@@ -2704,8 +2874,7 @@ class Locale extends Service {
|
|
|
2704
2874
|
return this.client.call('get', uri, {}, payload);
|
|
2705
2875
|
}
|
|
2706
2876
|
/**
|
|
2707
|
-
* List of all continents. You can use the locale header to get the data in a
|
|
2708
|
-
* supported language.
|
|
2877
|
+
* List of all continents. You can use the locale header to get the data in a supported language.
|
|
2709
2878
|
*
|
|
2710
2879
|
* @throws {AppwriteException}
|
|
2711
2880
|
* @returns {Promise}
|
|
@@ -2717,8 +2886,7 @@ class Locale extends Service {
|
|
|
2717
2886
|
return this.client.call('get', uri, {}, payload);
|
|
2718
2887
|
}
|
|
2719
2888
|
/**
|
|
2720
|
-
* List of all countries. You can use the locale header to get the data in a
|
|
2721
|
-
* supported language.
|
|
2889
|
+
* List of all countries. You can use the locale header to get the data in a supported language.
|
|
2722
2890
|
*
|
|
2723
2891
|
* @throws {AppwriteException}
|
|
2724
2892
|
* @returns {Promise}
|
|
@@ -2730,8 +2898,7 @@ class Locale extends Service {
|
|
|
2730
2898
|
return this.client.call('get', uri, {}, payload);
|
|
2731
2899
|
}
|
|
2732
2900
|
/**
|
|
2733
|
-
* List of all countries that are currently members of the EU. You can use the
|
|
2734
|
-
* locale header to get the data in a supported language.
|
|
2901
|
+
* 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.
|
|
2735
2902
|
*
|
|
2736
2903
|
* @throws {AppwriteException}
|
|
2737
2904
|
* @returns {Promise}
|
|
@@ -2743,8 +2910,7 @@ class Locale extends Service {
|
|
|
2743
2910
|
return this.client.call('get', uri, {}, payload);
|
|
2744
2911
|
}
|
|
2745
2912
|
/**
|
|
2746
|
-
* List of all countries phone codes. You can use the locale header to get the
|
|
2747
|
-
* data in a supported language.
|
|
2913
|
+
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
|
2748
2914
|
*
|
|
2749
2915
|
* @throws {AppwriteException}
|
|
2750
2916
|
* @returns {Promise}
|
|
@@ -2756,9 +2922,7 @@ class Locale extends Service {
|
|
|
2756
2922
|
return this.client.call('get', uri, {}, payload);
|
|
2757
2923
|
}
|
|
2758
2924
|
/**
|
|
2759
|
-
* List of all currencies, including currency symbol, name, plural, and
|
|
2760
|
-
* decimal digits for all major and minor currencies. You can use the locale
|
|
2761
|
-
* header to get the data in a supported language.
|
|
2925
|
+
* 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.
|
|
2762
2926
|
*
|
|
2763
2927
|
* @throws {AppwriteException}
|
|
2764
2928
|
* @returns {Promise}
|
|
@@ -2770,8 +2934,7 @@ class Locale extends Service {
|
|
|
2770
2934
|
return this.client.call('get', uri, {}, payload);
|
|
2771
2935
|
}
|
|
2772
2936
|
/**
|
|
2773
|
-
* List of all languages classified by ISO 639-1 including 2-letter code, name
|
|
2774
|
-
* in English, and name in the respective language.
|
|
2937
|
+
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
|
2775
2938
|
*
|
|
2776
2939
|
* @throws {AppwriteException}
|
|
2777
2940
|
* @returns {Promise}
|
|
@@ -2788,16 +2951,21 @@ class Messaging extends Service {
|
|
|
2788
2951
|
constructor(client) {
|
|
2789
2952
|
super(client);
|
|
2790
2953
|
}
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2954
|
+
createSubscriber(paramsOrFirst, ...rest) {
|
|
2955
|
+
let params;
|
|
2956
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2957
|
+
params = (paramsOrFirst || {});
|
|
2958
|
+
}
|
|
2959
|
+
else {
|
|
2960
|
+
params = {
|
|
2961
|
+
topicId: paramsOrFirst,
|
|
2962
|
+
subscriberId: rest[0],
|
|
2963
|
+
targetId: rest[1]
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
const topicId = params.topicId;
|
|
2967
|
+
const subscriberId = params.subscriberId;
|
|
2968
|
+
const targetId = params.targetId;
|
|
2801
2969
|
if (typeof topicId === 'undefined') {
|
|
2802
2970
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2803
2971
|
}
|
|
@@ -2820,15 +2988,19 @@ class Messaging extends Service {
|
|
|
2820
2988
|
'content-type': 'application/json',
|
|
2821
2989
|
}, payload);
|
|
2822
2990
|
}
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2991
|
+
deleteSubscriber(paramsOrFirst, ...rest) {
|
|
2992
|
+
let params;
|
|
2993
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2994
|
+
params = (paramsOrFirst || {});
|
|
2995
|
+
}
|
|
2996
|
+
else {
|
|
2997
|
+
params = {
|
|
2998
|
+
topicId: paramsOrFirst,
|
|
2999
|
+
subscriberId: rest[0]
|
|
3000
|
+
};
|
|
3001
|
+
}
|
|
3002
|
+
const topicId = params.topicId;
|
|
3003
|
+
const subscriberId = params.subscriberId;
|
|
2832
3004
|
if (typeof topicId === 'undefined') {
|
|
2833
3005
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2834
3006
|
}
|
|
@@ -2848,17 +3020,21 @@ class Storage extends Service {
|
|
|
2848
3020
|
constructor(client) {
|
|
2849
3021
|
super(client);
|
|
2850
3022
|
}
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
3023
|
+
listFiles(paramsOrFirst, ...rest) {
|
|
3024
|
+
let params;
|
|
3025
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3026
|
+
params = (paramsOrFirst || {});
|
|
3027
|
+
}
|
|
3028
|
+
else {
|
|
3029
|
+
params = {
|
|
3030
|
+
bucketId: paramsOrFirst,
|
|
3031
|
+
queries: rest[0],
|
|
3032
|
+
search: rest[1]
|
|
3033
|
+
};
|
|
3034
|
+
}
|
|
3035
|
+
const bucketId = params.bucketId;
|
|
3036
|
+
const queries = params.queries;
|
|
3037
|
+
const search = params.search;
|
|
2862
3038
|
if (typeof bucketId === 'undefined') {
|
|
2863
3039
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2864
3040
|
}
|
|
@@ -2873,35 +3049,27 @@ class Storage extends Service {
|
|
|
2873
3049
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2874
3050
|
return this.client.call('get', uri, {}, payload);
|
|
2875
3051
|
}
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
* @param {string} fileId
|
|
2898
|
-
* @param {{name: string, type: string, size: number, uri: string}} file
|
|
2899
|
-
* @param {string[]} permissions
|
|
2900
|
-
* @throws {AppwriteException}
|
|
2901
|
-
* @returns {Promise}
|
|
2902
|
-
*/
|
|
2903
|
-
createFile(bucketId_1, fileId_1, file_1, permissions_1) {
|
|
2904
|
-
return __awaiter(this, arguments, void 0, function* (bucketId, fileId, file, permissions, onProgress = (progress) => { }) {
|
|
3052
|
+
createFile(paramsOrFirst, ...rest) {
|
|
3053
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3054
|
+
let params;
|
|
3055
|
+
let onProgress;
|
|
3056
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3057
|
+
params = (paramsOrFirst || {});
|
|
3058
|
+
onProgress = paramsOrFirst === null || paramsOrFirst === void 0 ? void 0 : paramsOrFirst.onProgress;
|
|
3059
|
+
}
|
|
3060
|
+
else {
|
|
3061
|
+
params = {
|
|
3062
|
+
bucketId: paramsOrFirst,
|
|
3063
|
+
fileId: rest[0],
|
|
3064
|
+
file: rest[1],
|
|
3065
|
+
permissions: rest[2]
|
|
3066
|
+
};
|
|
3067
|
+
onProgress = rest[3];
|
|
3068
|
+
}
|
|
3069
|
+
const bucketId = params.bucketId;
|
|
3070
|
+
const fileId = params.fileId;
|
|
3071
|
+
const file = params.file;
|
|
3072
|
+
const permissions = params.permissions;
|
|
2905
3073
|
if (typeof bucketId === 'undefined') {
|
|
2906
3074
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2907
3075
|
}
|
|
@@ -2973,16 +3141,19 @@ class Storage extends Service {
|
|
|
2973
3141
|
return response;
|
|
2974
3142
|
});
|
|
2975
3143
|
}
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
3144
|
+
getFile(paramsOrFirst, ...rest) {
|
|
3145
|
+
let params;
|
|
3146
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3147
|
+
params = (paramsOrFirst || {});
|
|
3148
|
+
}
|
|
3149
|
+
else {
|
|
3150
|
+
params = {
|
|
3151
|
+
bucketId: paramsOrFirst,
|
|
3152
|
+
fileId: rest[0]
|
|
3153
|
+
};
|
|
3154
|
+
}
|
|
3155
|
+
const bucketId = params.bucketId;
|
|
3156
|
+
const fileId = params.fileId;
|
|
2986
3157
|
if (typeof bucketId === 'undefined') {
|
|
2987
3158
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2988
3159
|
}
|
|
@@ -2994,18 +3165,23 @@ class Storage extends Service {
|
|
|
2994
3165
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2995
3166
|
return this.client.call('get', uri, {}, payload);
|
|
2996
3167
|
}
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3168
|
+
updateFile(paramsOrFirst, ...rest) {
|
|
3169
|
+
let params;
|
|
3170
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3171
|
+
params = (paramsOrFirst || {});
|
|
3172
|
+
}
|
|
3173
|
+
else {
|
|
3174
|
+
params = {
|
|
3175
|
+
bucketId: paramsOrFirst,
|
|
3176
|
+
fileId: rest[0],
|
|
3177
|
+
name: rest[1],
|
|
3178
|
+
permissions: rest[2]
|
|
3179
|
+
};
|
|
3180
|
+
}
|
|
3181
|
+
const bucketId = params.bucketId;
|
|
3182
|
+
const fileId = params.fileId;
|
|
3183
|
+
const name = params.name;
|
|
3184
|
+
const permissions = params.permissions;
|
|
3009
3185
|
if (typeof bucketId === 'undefined') {
|
|
3010
3186
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3011
3187
|
}
|
|
@@ -3025,16 +3201,19 @@ class Storage extends Service {
|
|
|
3025
3201
|
'content-type': 'application/json',
|
|
3026
3202
|
}, payload);
|
|
3027
3203
|
}
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3204
|
+
deleteFile(paramsOrFirst, ...rest) {
|
|
3205
|
+
let params;
|
|
3206
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3207
|
+
params = (paramsOrFirst || {});
|
|
3208
|
+
}
|
|
3209
|
+
else {
|
|
3210
|
+
params = {
|
|
3211
|
+
bucketId: paramsOrFirst,
|
|
3212
|
+
fileId: rest[0]
|
|
3213
|
+
};
|
|
3214
|
+
}
|
|
3215
|
+
const bucketId = params.bucketId;
|
|
3216
|
+
const fileId = params.fileId;
|
|
3038
3217
|
if (typeof bucketId === 'undefined') {
|
|
3039
3218
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3040
3219
|
}
|
|
@@ -3048,18 +3227,21 @@ class Storage extends Service {
|
|
|
3048
3227
|
'content-type': 'application/json',
|
|
3049
3228
|
}, payload);
|
|
3050
3229
|
}
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3230
|
+
getFileDownload(paramsOrFirst, ...rest) {
|
|
3231
|
+
let params;
|
|
3232
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3233
|
+
params = (paramsOrFirst || {});
|
|
3234
|
+
}
|
|
3235
|
+
else {
|
|
3236
|
+
params = {
|
|
3237
|
+
bucketId: paramsOrFirst,
|
|
3238
|
+
fileId: rest[0],
|
|
3239
|
+
token: rest[1]
|
|
3240
|
+
};
|
|
3241
|
+
}
|
|
3242
|
+
const bucketId = params.bucketId;
|
|
3243
|
+
const fileId = params.fileId;
|
|
3244
|
+
const token = params.token;
|
|
3063
3245
|
if (typeof bucketId === 'undefined') {
|
|
3064
3246
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3065
3247
|
}
|
|
@@ -3078,31 +3260,43 @@ class Storage extends Service {
|
|
|
3078
3260
|
}
|
|
3079
3261
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
3080
3262
|
}
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3263
|
+
getFilePreview(paramsOrFirst, ...rest) {
|
|
3264
|
+
let params;
|
|
3265
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3266
|
+
params = (paramsOrFirst || {});
|
|
3267
|
+
}
|
|
3268
|
+
else {
|
|
3269
|
+
params = {
|
|
3270
|
+
bucketId: paramsOrFirst,
|
|
3271
|
+
fileId: rest[0],
|
|
3272
|
+
width: rest[1],
|
|
3273
|
+
height: rest[2],
|
|
3274
|
+
gravity: rest[3],
|
|
3275
|
+
quality: rest[4],
|
|
3276
|
+
borderWidth: rest[5],
|
|
3277
|
+
borderColor: rest[6],
|
|
3278
|
+
borderRadius: rest[7],
|
|
3279
|
+
opacity: rest[8],
|
|
3280
|
+
rotation: rest[9],
|
|
3281
|
+
background: rest[10],
|
|
3282
|
+
output: rest[11],
|
|
3283
|
+
token: rest[12]
|
|
3284
|
+
};
|
|
3285
|
+
}
|
|
3286
|
+
const bucketId = params.bucketId;
|
|
3287
|
+
const fileId = params.fileId;
|
|
3288
|
+
const width = params.width;
|
|
3289
|
+
const height = params.height;
|
|
3290
|
+
const gravity = params.gravity;
|
|
3291
|
+
const quality = params.quality;
|
|
3292
|
+
const borderWidth = params.borderWidth;
|
|
3293
|
+
const borderColor = params.borderColor;
|
|
3294
|
+
const borderRadius = params.borderRadius;
|
|
3295
|
+
const opacity = params.opacity;
|
|
3296
|
+
const rotation = params.rotation;
|
|
3297
|
+
const background = params.background;
|
|
3298
|
+
const output = params.output;
|
|
3299
|
+
const token = params.token;
|
|
3106
3300
|
if (typeof bucketId === 'undefined') {
|
|
3107
3301
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3108
3302
|
}
|
|
@@ -3154,18 +3348,21 @@ class Storage extends Service {
|
|
|
3154
3348
|
}
|
|
3155
3349
|
return this.client.call('get', uri, {}, payload, 'arrayBuffer');
|
|
3156
3350
|
}
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3351
|
+
getFileView(paramsOrFirst, ...rest) {
|
|
3352
|
+
let params;
|
|
3353
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3354
|
+
params = (paramsOrFirst || {});
|
|
3355
|
+
}
|
|
3356
|
+
else {
|
|
3357
|
+
params = {
|
|
3358
|
+
bucketId: paramsOrFirst,
|
|
3359
|
+
fileId: rest[0],
|
|
3360
|
+
token: rest[1]
|
|
3361
|
+
};
|
|
3362
|
+
}
|
|
3363
|
+
const bucketId = params.bucketId;
|
|
3364
|
+
const fileId = params.fileId;
|
|
3365
|
+
const token = params.token;
|
|
3169
3366
|
if (typeof bucketId === 'undefined') {
|
|
3170
3367
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
3171
3368
|
}
|
|
@@ -3304,20 +3501,344 @@ class Storage extends Service {
|
|
|
3304
3501
|
}
|
|
3305
3502
|
}
|
|
3306
3503
|
|
|
3307
|
-
class
|
|
3504
|
+
class TablesDB extends Service {
|
|
3308
3505
|
constructor(client) {
|
|
3309
3506
|
super(client);
|
|
3310
3507
|
}
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3508
|
+
listRows(paramsOrFirst, ...rest) {
|
|
3509
|
+
let params;
|
|
3510
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3511
|
+
params = (paramsOrFirst || {});
|
|
3512
|
+
}
|
|
3513
|
+
else {
|
|
3514
|
+
params = {
|
|
3515
|
+
databaseId: paramsOrFirst,
|
|
3516
|
+
tableId: rest[0],
|
|
3517
|
+
queries: rest[1]
|
|
3518
|
+
};
|
|
3519
|
+
}
|
|
3520
|
+
const databaseId = params.databaseId;
|
|
3521
|
+
const tableId = params.tableId;
|
|
3522
|
+
const queries = params.queries;
|
|
3523
|
+
if (typeof databaseId === 'undefined') {
|
|
3524
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3525
|
+
}
|
|
3526
|
+
if (typeof tableId === 'undefined') {
|
|
3527
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3528
|
+
}
|
|
3529
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
|
|
3530
|
+
const payload = {};
|
|
3531
|
+
if (typeof queries !== 'undefined') {
|
|
3532
|
+
payload['queries'] = queries;
|
|
3533
|
+
}
|
|
3534
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3535
|
+
return this.client.call('get', uri, {}, payload);
|
|
3536
|
+
}
|
|
3537
|
+
createRow(paramsOrFirst, ...rest) {
|
|
3538
|
+
let params;
|
|
3539
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3540
|
+
params = (paramsOrFirst || {});
|
|
3541
|
+
}
|
|
3542
|
+
else {
|
|
3543
|
+
params = {
|
|
3544
|
+
databaseId: paramsOrFirst,
|
|
3545
|
+
tableId: rest[0],
|
|
3546
|
+
rowId: rest[1],
|
|
3547
|
+
data: rest[2],
|
|
3548
|
+
permissions: rest[3]
|
|
3549
|
+
};
|
|
3550
|
+
}
|
|
3551
|
+
const databaseId = params.databaseId;
|
|
3552
|
+
const tableId = params.tableId;
|
|
3553
|
+
const rowId = params.rowId;
|
|
3554
|
+
const data = params.data;
|
|
3555
|
+
const permissions = params.permissions;
|
|
3556
|
+
if (typeof databaseId === 'undefined') {
|
|
3557
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3558
|
+
}
|
|
3559
|
+
if (typeof tableId === 'undefined') {
|
|
3560
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3561
|
+
}
|
|
3562
|
+
if (typeof rowId === 'undefined') {
|
|
3563
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3564
|
+
}
|
|
3565
|
+
if (typeof data === 'undefined') {
|
|
3566
|
+
throw new AppwriteException('Missing required parameter: "data"');
|
|
3567
|
+
}
|
|
3568
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
|
|
3569
|
+
const payload = {};
|
|
3570
|
+
if (typeof rowId !== 'undefined') {
|
|
3571
|
+
payload['rowId'] = rowId;
|
|
3572
|
+
}
|
|
3573
|
+
if (typeof data !== 'undefined') {
|
|
3574
|
+
payload['data'] = data;
|
|
3575
|
+
}
|
|
3576
|
+
if (typeof permissions !== 'undefined') {
|
|
3577
|
+
payload['permissions'] = permissions;
|
|
3578
|
+
}
|
|
3579
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3580
|
+
return this.client.call('post', uri, {
|
|
3581
|
+
'content-type': 'application/json',
|
|
3582
|
+
}, payload);
|
|
3583
|
+
}
|
|
3584
|
+
getRow(paramsOrFirst, ...rest) {
|
|
3585
|
+
let params;
|
|
3586
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3587
|
+
params = (paramsOrFirst || {});
|
|
3588
|
+
}
|
|
3589
|
+
else {
|
|
3590
|
+
params = {
|
|
3591
|
+
databaseId: paramsOrFirst,
|
|
3592
|
+
tableId: rest[0],
|
|
3593
|
+
rowId: rest[1],
|
|
3594
|
+
queries: rest[2]
|
|
3595
|
+
};
|
|
3596
|
+
}
|
|
3597
|
+
const databaseId = params.databaseId;
|
|
3598
|
+
const tableId = params.tableId;
|
|
3599
|
+
const rowId = params.rowId;
|
|
3600
|
+
const queries = params.queries;
|
|
3601
|
+
if (typeof databaseId === 'undefined') {
|
|
3602
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3603
|
+
}
|
|
3604
|
+
if (typeof tableId === 'undefined') {
|
|
3605
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3606
|
+
}
|
|
3607
|
+
if (typeof rowId === 'undefined') {
|
|
3608
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3609
|
+
}
|
|
3610
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
|
|
3611
|
+
const payload = {};
|
|
3612
|
+
if (typeof queries !== 'undefined') {
|
|
3613
|
+
payload['queries'] = queries;
|
|
3614
|
+
}
|
|
3615
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3616
|
+
return this.client.call('get', uri, {}, payload);
|
|
3617
|
+
}
|
|
3618
|
+
upsertRow(paramsOrFirst, ...rest) {
|
|
3619
|
+
let params;
|
|
3620
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3621
|
+
params = (paramsOrFirst || {});
|
|
3622
|
+
}
|
|
3623
|
+
else {
|
|
3624
|
+
params = {
|
|
3625
|
+
databaseId: paramsOrFirst,
|
|
3626
|
+
tableId: rest[0],
|
|
3627
|
+
rowId: rest[1],
|
|
3628
|
+
data: rest[2],
|
|
3629
|
+
permissions: rest[3]
|
|
3630
|
+
};
|
|
3631
|
+
}
|
|
3632
|
+
const databaseId = params.databaseId;
|
|
3633
|
+
const tableId = params.tableId;
|
|
3634
|
+
const rowId = params.rowId;
|
|
3635
|
+
const data = params.data;
|
|
3636
|
+
const permissions = params.permissions;
|
|
3637
|
+
if (typeof databaseId === 'undefined') {
|
|
3638
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3639
|
+
}
|
|
3640
|
+
if (typeof tableId === 'undefined') {
|
|
3641
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3642
|
+
}
|
|
3643
|
+
if (typeof rowId === 'undefined') {
|
|
3644
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3645
|
+
}
|
|
3646
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
|
|
3647
|
+
const payload = {};
|
|
3648
|
+
if (typeof data !== 'undefined') {
|
|
3649
|
+
payload['data'] = data;
|
|
3650
|
+
}
|
|
3651
|
+
if (typeof permissions !== 'undefined') {
|
|
3652
|
+
payload['permissions'] = permissions;
|
|
3653
|
+
}
|
|
3654
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3655
|
+
return this.client.call('put', uri, {
|
|
3656
|
+
'content-type': 'application/json',
|
|
3657
|
+
}, payload);
|
|
3658
|
+
}
|
|
3659
|
+
updateRow(paramsOrFirst, ...rest) {
|
|
3660
|
+
let params;
|
|
3661
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3662
|
+
params = (paramsOrFirst || {});
|
|
3663
|
+
}
|
|
3664
|
+
else {
|
|
3665
|
+
params = {
|
|
3666
|
+
databaseId: paramsOrFirst,
|
|
3667
|
+
tableId: rest[0],
|
|
3668
|
+
rowId: rest[1],
|
|
3669
|
+
data: rest[2],
|
|
3670
|
+
permissions: rest[3]
|
|
3671
|
+
};
|
|
3672
|
+
}
|
|
3673
|
+
const databaseId = params.databaseId;
|
|
3674
|
+
const tableId = params.tableId;
|
|
3675
|
+
const rowId = params.rowId;
|
|
3676
|
+
const data = params.data;
|
|
3677
|
+
const permissions = params.permissions;
|
|
3678
|
+
if (typeof databaseId === 'undefined') {
|
|
3679
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3680
|
+
}
|
|
3681
|
+
if (typeof tableId === 'undefined') {
|
|
3682
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3683
|
+
}
|
|
3684
|
+
if (typeof rowId === 'undefined') {
|
|
3685
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3686
|
+
}
|
|
3687
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
|
|
3688
|
+
const payload = {};
|
|
3689
|
+
if (typeof data !== 'undefined') {
|
|
3690
|
+
payload['data'] = data;
|
|
3691
|
+
}
|
|
3692
|
+
if (typeof permissions !== 'undefined') {
|
|
3693
|
+
payload['permissions'] = permissions;
|
|
3694
|
+
}
|
|
3695
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3696
|
+
return this.client.call('patch', uri, {
|
|
3697
|
+
'content-type': 'application/json',
|
|
3698
|
+
}, payload);
|
|
3699
|
+
}
|
|
3700
|
+
deleteRow(paramsOrFirst, ...rest) {
|
|
3701
|
+
let params;
|
|
3702
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3703
|
+
params = (paramsOrFirst || {});
|
|
3704
|
+
}
|
|
3705
|
+
else {
|
|
3706
|
+
params = {
|
|
3707
|
+
databaseId: paramsOrFirst,
|
|
3708
|
+
tableId: rest[0],
|
|
3709
|
+
rowId: rest[1]
|
|
3710
|
+
};
|
|
3711
|
+
}
|
|
3712
|
+
const databaseId = params.databaseId;
|
|
3713
|
+
const tableId = params.tableId;
|
|
3714
|
+
const rowId = params.rowId;
|
|
3715
|
+
if (typeof databaseId === 'undefined') {
|
|
3716
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3717
|
+
}
|
|
3718
|
+
if (typeof tableId === 'undefined') {
|
|
3719
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3720
|
+
}
|
|
3721
|
+
if (typeof rowId === 'undefined') {
|
|
3722
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3723
|
+
}
|
|
3724
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
|
|
3725
|
+
const payload = {};
|
|
3726
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3727
|
+
return this.client.call('delete', uri, {
|
|
3728
|
+
'content-type': 'application/json',
|
|
3729
|
+
}, payload);
|
|
3730
|
+
}
|
|
3731
|
+
decrementRowColumn(paramsOrFirst, ...rest) {
|
|
3732
|
+
let params;
|
|
3733
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3734
|
+
params = (paramsOrFirst || {});
|
|
3735
|
+
}
|
|
3736
|
+
else {
|
|
3737
|
+
params = {
|
|
3738
|
+
databaseId: paramsOrFirst,
|
|
3739
|
+
tableId: rest[0],
|
|
3740
|
+
rowId: rest[1],
|
|
3741
|
+
column: rest[2],
|
|
3742
|
+
value: rest[3],
|
|
3743
|
+
min: rest[4]
|
|
3744
|
+
};
|
|
3745
|
+
}
|
|
3746
|
+
const databaseId = params.databaseId;
|
|
3747
|
+
const tableId = params.tableId;
|
|
3748
|
+
const rowId = params.rowId;
|
|
3749
|
+
const column = params.column;
|
|
3750
|
+
const value = params.value;
|
|
3751
|
+
const min = params.min;
|
|
3752
|
+
if (typeof databaseId === 'undefined') {
|
|
3753
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3754
|
+
}
|
|
3755
|
+
if (typeof tableId === 'undefined') {
|
|
3756
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3757
|
+
}
|
|
3758
|
+
if (typeof rowId === 'undefined') {
|
|
3759
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3760
|
+
}
|
|
3761
|
+
if (typeof column === 'undefined') {
|
|
3762
|
+
throw new AppwriteException('Missing required parameter: "column"');
|
|
3763
|
+
}
|
|
3764
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
|
|
3765
|
+
const payload = {};
|
|
3766
|
+
if (typeof value !== 'undefined') {
|
|
3767
|
+
payload['value'] = value;
|
|
3768
|
+
}
|
|
3769
|
+
if (typeof min !== 'undefined') {
|
|
3770
|
+
payload['min'] = min;
|
|
3771
|
+
}
|
|
3772
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3773
|
+
return this.client.call('patch', uri, {
|
|
3774
|
+
'content-type': 'application/json',
|
|
3775
|
+
}, payload);
|
|
3776
|
+
}
|
|
3777
|
+
incrementRowColumn(paramsOrFirst, ...rest) {
|
|
3778
|
+
let params;
|
|
3779
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3780
|
+
params = (paramsOrFirst || {});
|
|
3781
|
+
}
|
|
3782
|
+
else {
|
|
3783
|
+
params = {
|
|
3784
|
+
databaseId: paramsOrFirst,
|
|
3785
|
+
tableId: rest[0],
|
|
3786
|
+
rowId: rest[1],
|
|
3787
|
+
column: rest[2],
|
|
3788
|
+
value: rest[3],
|
|
3789
|
+
max: rest[4]
|
|
3790
|
+
};
|
|
3791
|
+
}
|
|
3792
|
+
const databaseId = params.databaseId;
|
|
3793
|
+
const tableId = params.tableId;
|
|
3794
|
+
const rowId = params.rowId;
|
|
3795
|
+
const column = params.column;
|
|
3796
|
+
const value = params.value;
|
|
3797
|
+
const max = params.max;
|
|
3798
|
+
if (typeof databaseId === 'undefined') {
|
|
3799
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3800
|
+
}
|
|
3801
|
+
if (typeof tableId === 'undefined') {
|
|
3802
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
3803
|
+
}
|
|
3804
|
+
if (typeof rowId === 'undefined') {
|
|
3805
|
+
throw new AppwriteException('Missing required parameter: "rowId"');
|
|
3806
|
+
}
|
|
3807
|
+
if (typeof column === 'undefined') {
|
|
3808
|
+
throw new AppwriteException('Missing required parameter: "column"');
|
|
3809
|
+
}
|
|
3810
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
|
|
3811
|
+
const payload = {};
|
|
3812
|
+
if (typeof value !== 'undefined') {
|
|
3813
|
+
payload['value'] = value;
|
|
3814
|
+
}
|
|
3815
|
+
if (typeof max !== 'undefined') {
|
|
3816
|
+
payload['max'] = max;
|
|
3817
|
+
}
|
|
3818
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3819
|
+
return this.client.call('patch', uri, {
|
|
3820
|
+
'content-type': 'application/json',
|
|
3821
|
+
}, payload);
|
|
3822
|
+
}
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3825
|
+
class Teams extends Service {
|
|
3826
|
+
constructor(client) {
|
|
3827
|
+
super(client);
|
|
3828
|
+
}
|
|
3829
|
+
list(paramsOrFirst, ...rest) {
|
|
3830
|
+
let params;
|
|
3831
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3832
|
+
params = (paramsOrFirst || {});
|
|
3833
|
+
}
|
|
3834
|
+
else {
|
|
3835
|
+
params = {
|
|
3836
|
+
queries: paramsOrFirst,
|
|
3837
|
+
search: rest[0]
|
|
3838
|
+
};
|
|
3839
|
+
}
|
|
3840
|
+
const queries = params.queries;
|
|
3841
|
+
const search = params.search;
|
|
3321
3842
|
const apiPath = '/teams';
|
|
3322
3843
|
const payload = {};
|
|
3323
3844
|
if (typeof queries !== 'undefined') {
|
|
@@ -3329,18 +3850,21 @@ class Teams extends Service {
|
|
|
3329
3850
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3330
3851
|
return this.client.call('get', uri, {}, payload);
|
|
3331
3852
|
}
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3853
|
+
create(paramsOrFirst, ...rest) {
|
|
3854
|
+
let params;
|
|
3855
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3856
|
+
params = (paramsOrFirst || {});
|
|
3857
|
+
}
|
|
3858
|
+
else {
|
|
3859
|
+
params = {
|
|
3860
|
+
teamId: paramsOrFirst,
|
|
3861
|
+
name: rest[0],
|
|
3862
|
+
roles: rest[1]
|
|
3863
|
+
};
|
|
3864
|
+
}
|
|
3865
|
+
const teamId = params.teamId;
|
|
3866
|
+
const name = params.name;
|
|
3867
|
+
const roles = params.roles;
|
|
3344
3868
|
if (typeof teamId === 'undefined') {
|
|
3345
3869
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3346
3870
|
}
|
|
@@ -3363,14 +3887,17 @@ class Teams extends Service {
|
|
|
3363
3887
|
'content-type': 'application/json',
|
|
3364
3888
|
}, payload);
|
|
3365
3889
|
}
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3890
|
+
get(paramsOrFirst) {
|
|
3891
|
+
let params;
|
|
3892
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3893
|
+
params = (paramsOrFirst || {});
|
|
3894
|
+
}
|
|
3895
|
+
else {
|
|
3896
|
+
params = {
|
|
3897
|
+
teamId: paramsOrFirst
|
|
3898
|
+
};
|
|
3899
|
+
}
|
|
3900
|
+
const teamId = params.teamId;
|
|
3374
3901
|
if (typeof teamId === 'undefined') {
|
|
3375
3902
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3376
3903
|
}
|
|
@@ -3379,15 +3906,19 @@ class Teams extends Service {
|
|
|
3379
3906
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3380
3907
|
return this.client.call('get', uri, {}, payload);
|
|
3381
3908
|
}
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3909
|
+
updateName(paramsOrFirst, ...rest) {
|
|
3910
|
+
let params;
|
|
3911
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3912
|
+
params = (paramsOrFirst || {});
|
|
3913
|
+
}
|
|
3914
|
+
else {
|
|
3915
|
+
params = {
|
|
3916
|
+
teamId: paramsOrFirst,
|
|
3917
|
+
name: rest[0]
|
|
3918
|
+
};
|
|
3919
|
+
}
|
|
3920
|
+
const teamId = params.teamId;
|
|
3921
|
+
const name = params.name;
|
|
3391
3922
|
if (typeof teamId === 'undefined') {
|
|
3392
3923
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3393
3924
|
}
|
|
@@ -3404,15 +3935,17 @@ class Teams extends Service {
|
|
|
3404
3935
|
'content-type': 'application/json',
|
|
3405
3936
|
}, payload);
|
|
3406
3937
|
}
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3938
|
+
delete(paramsOrFirst) {
|
|
3939
|
+
let params;
|
|
3940
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3941
|
+
params = (paramsOrFirst || {});
|
|
3942
|
+
}
|
|
3943
|
+
else {
|
|
3944
|
+
params = {
|
|
3945
|
+
teamId: paramsOrFirst
|
|
3946
|
+
};
|
|
3947
|
+
}
|
|
3948
|
+
const teamId = params.teamId;
|
|
3416
3949
|
if (typeof teamId === 'undefined') {
|
|
3417
3950
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3418
3951
|
}
|
|
@@ -3423,18 +3956,21 @@ class Teams extends Service {
|
|
|
3423
3956
|
'content-type': 'application/json',
|
|
3424
3957
|
}, payload);
|
|
3425
3958
|
}
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3959
|
+
listMemberships(paramsOrFirst, ...rest) {
|
|
3960
|
+
let params;
|
|
3961
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3962
|
+
params = (paramsOrFirst || {});
|
|
3963
|
+
}
|
|
3964
|
+
else {
|
|
3965
|
+
params = {
|
|
3966
|
+
teamId: paramsOrFirst,
|
|
3967
|
+
queries: rest[0],
|
|
3968
|
+
search: rest[1]
|
|
3969
|
+
};
|
|
3970
|
+
}
|
|
3971
|
+
const teamId = params.teamId;
|
|
3972
|
+
const queries = params.queries;
|
|
3973
|
+
const search = params.search;
|
|
3438
3974
|
if (typeof teamId === 'undefined') {
|
|
3439
3975
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3440
3976
|
}
|
|
@@ -3449,40 +3985,29 @@ class Teams extends Service {
|
|
|
3449
3985
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3450
3986
|
return this.client.call('get', uri, {}, payload);
|
|
3451
3987
|
}
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
* @param {string} teamId
|
|
3476
|
-
* @param {string[]} roles
|
|
3477
|
-
* @param {string} email
|
|
3478
|
-
* @param {string} userId
|
|
3479
|
-
* @param {string} phone
|
|
3480
|
-
* @param {string} url
|
|
3481
|
-
* @param {string} name
|
|
3482
|
-
* @throws {AppwriteException}
|
|
3483
|
-
* @returns {Promise}
|
|
3484
|
-
*/
|
|
3485
|
-
createMembership(teamId, roles, email, userId, phone, url, name) {
|
|
3988
|
+
createMembership(paramsOrFirst, ...rest) {
|
|
3989
|
+
let params;
|
|
3990
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3991
|
+
params = (paramsOrFirst || {});
|
|
3992
|
+
}
|
|
3993
|
+
else {
|
|
3994
|
+
params = {
|
|
3995
|
+
teamId: paramsOrFirst,
|
|
3996
|
+
roles: rest[0],
|
|
3997
|
+
email: rest[1],
|
|
3998
|
+
userId: rest[2],
|
|
3999
|
+
phone: rest[3],
|
|
4000
|
+
url: rest[4],
|
|
4001
|
+
name: rest[5]
|
|
4002
|
+
};
|
|
4003
|
+
}
|
|
4004
|
+
const teamId = params.teamId;
|
|
4005
|
+
const roles = params.roles;
|
|
4006
|
+
const email = params.email;
|
|
4007
|
+
const userId = params.userId;
|
|
4008
|
+
const phone = params.phone;
|
|
4009
|
+
const url = params.url;
|
|
4010
|
+
const name = params.name;
|
|
3486
4011
|
if (typeof teamId === 'undefined') {
|
|
3487
4012
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3488
4013
|
}
|
|
@@ -3514,17 +4039,19 @@ class Teams extends Service {
|
|
|
3514
4039
|
'content-type': 'application/json',
|
|
3515
4040
|
}, payload);
|
|
3516
4041
|
}
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
4042
|
+
getMembership(paramsOrFirst, ...rest) {
|
|
4043
|
+
let params;
|
|
4044
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4045
|
+
params = (paramsOrFirst || {});
|
|
4046
|
+
}
|
|
4047
|
+
else {
|
|
4048
|
+
params = {
|
|
4049
|
+
teamId: paramsOrFirst,
|
|
4050
|
+
membershipId: rest[0]
|
|
4051
|
+
};
|
|
4052
|
+
}
|
|
4053
|
+
const teamId = params.teamId;
|
|
4054
|
+
const membershipId = params.membershipId;
|
|
3528
4055
|
if (typeof teamId === 'undefined') {
|
|
3529
4056
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3530
4057
|
}
|
|
@@ -3536,19 +4063,21 @@ class Teams extends Service {
|
|
|
3536
4063
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3537
4064
|
return this.client.call('get', uri, {}, payload);
|
|
3538
4065
|
}
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
4066
|
+
updateMembership(paramsOrFirst, ...rest) {
|
|
4067
|
+
let params;
|
|
4068
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4069
|
+
params = (paramsOrFirst || {});
|
|
4070
|
+
}
|
|
4071
|
+
else {
|
|
4072
|
+
params = {
|
|
4073
|
+
teamId: paramsOrFirst,
|
|
4074
|
+
membershipId: rest[0],
|
|
4075
|
+
roles: rest[1]
|
|
4076
|
+
};
|
|
4077
|
+
}
|
|
4078
|
+
const teamId = params.teamId;
|
|
4079
|
+
const membershipId = params.membershipId;
|
|
4080
|
+
const roles = params.roles;
|
|
3552
4081
|
if (typeof teamId === 'undefined') {
|
|
3553
4082
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3554
4083
|
}
|
|
@@ -3568,17 +4097,19 @@ class Teams extends Service {
|
|
|
3568
4097
|
'content-type': 'application/json',
|
|
3569
4098
|
}, payload);
|
|
3570
4099
|
}
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
4100
|
+
deleteMembership(paramsOrFirst, ...rest) {
|
|
4101
|
+
let params;
|
|
4102
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4103
|
+
params = (paramsOrFirst || {});
|
|
4104
|
+
}
|
|
4105
|
+
else {
|
|
4106
|
+
params = {
|
|
4107
|
+
teamId: paramsOrFirst,
|
|
4108
|
+
membershipId: rest[0]
|
|
4109
|
+
};
|
|
4110
|
+
}
|
|
4111
|
+
const teamId = params.teamId;
|
|
4112
|
+
const membershipId = params.membershipId;
|
|
3582
4113
|
if (typeof teamId === 'undefined') {
|
|
3583
4114
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3584
4115
|
}
|
|
@@ -3592,23 +4123,23 @@ class Teams extends Service {
|
|
|
3592
4123
|
'content-type': 'application/json',
|
|
3593
4124
|
}, payload);
|
|
3594
4125
|
}
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
4126
|
+
updateMembershipStatus(paramsOrFirst, ...rest) {
|
|
4127
|
+
let params;
|
|
4128
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4129
|
+
params = (paramsOrFirst || {});
|
|
4130
|
+
}
|
|
4131
|
+
else {
|
|
4132
|
+
params = {
|
|
4133
|
+
teamId: paramsOrFirst,
|
|
4134
|
+
membershipId: rest[0],
|
|
4135
|
+
userId: rest[1],
|
|
4136
|
+
secret: rest[2]
|
|
4137
|
+
};
|
|
4138
|
+
}
|
|
4139
|
+
const teamId = params.teamId;
|
|
4140
|
+
const membershipId = params.membershipId;
|
|
4141
|
+
const userId = params.userId;
|
|
4142
|
+
const secret = params.secret;
|
|
3612
4143
|
if (typeof teamId === 'undefined') {
|
|
3613
4144
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3614
4145
|
}
|
|
@@ -3634,16 +4165,17 @@ class Teams extends Service {
|
|
|
3634
4165
|
'content-type': 'application/json',
|
|
3635
4166
|
}, payload);
|
|
3636
4167
|
}
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
4168
|
+
getPrefs(paramsOrFirst) {
|
|
4169
|
+
let params;
|
|
4170
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4171
|
+
params = (paramsOrFirst || {});
|
|
4172
|
+
}
|
|
4173
|
+
else {
|
|
4174
|
+
params = {
|
|
4175
|
+
teamId: paramsOrFirst
|
|
4176
|
+
};
|
|
4177
|
+
}
|
|
4178
|
+
const teamId = params.teamId;
|
|
3647
4179
|
if (typeof teamId === 'undefined') {
|
|
3648
4180
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3649
4181
|
}
|
|
@@ -3652,17 +4184,19 @@ class Teams extends Service {
|
|
|
3652
4184
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3653
4185
|
return this.client.call('get', uri, {}, payload);
|
|
3654
4186
|
}
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
4187
|
+
updatePrefs(paramsOrFirst, ...rest) {
|
|
4188
|
+
let params;
|
|
4189
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4190
|
+
params = (paramsOrFirst || {});
|
|
4191
|
+
}
|
|
4192
|
+
else {
|
|
4193
|
+
params = {
|
|
4194
|
+
teamId: paramsOrFirst,
|
|
4195
|
+
prefs: rest[0]
|
|
4196
|
+
};
|
|
4197
|
+
}
|
|
4198
|
+
const teamId = params.teamId;
|
|
4199
|
+
const prefs = params.prefs;
|
|
3666
4200
|
if (typeof teamId === 'undefined') {
|
|
3667
4201
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
3668
4202
|
}
|
|
@@ -3721,9 +4255,206 @@ Query.cursorAfter = (documentId) => new Query("cursorAfter", undefined, document
|
|
|
3721
4255
|
Query.cursorBefore = (documentId) => new Query("cursorBefore", undefined, documentId).toString();
|
|
3722
4256
|
Query.limit = (limit) => new Query("limit", undefined, limit).toString();
|
|
3723
4257
|
Query.offset = (offset) => new Query("offset", undefined, offset).toString();
|
|
4258
|
+
/**
|
|
4259
|
+
* Filter resources where attribute contains the specified value.
|
|
4260
|
+
*
|
|
4261
|
+
* @param {string} attribute
|
|
4262
|
+
* @param {string | string[]} value
|
|
4263
|
+
* @returns {string}
|
|
4264
|
+
*/
|
|
3724
4265
|
Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
|
|
4266
|
+
/**
|
|
4267
|
+
* Filter resources where attribute does not contain the specified value.
|
|
4268
|
+
*
|
|
4269
|
+
* @param {string} attribute
|
|
4270
|
+
* @param {string | string[]} value
|
|
4271
|
+
* @returns {string}
|
|
4272
|
+
*/
|
|
4273
|
+
Query.notContains = (attribute, value) => new Query("notContains", attribute, value).toString();
|
|
4274
|
+
/**
|
|
4275
|
+
* Filter resources by searching attribute for value (inverse of search).
|
|
4276
|
+
* A fulltext index on attribute is required for this query to work.
|
|
4277
|
+
*
|
|
4278
|
+
* @param {string} attribute
|
|
4279
|
+
* @param {string} value
|
|
4280
|
+
* @returns {string}
|
|
4281
|
+
*/
|
|
4282
|
+
Query.notSearch = (attribute, value) => new Query("notSearch", attribute, value).toString();
|
|
4283
|
+
/**
|
|
4284
|
+
* Filter resources where attribute is not between start and end (exclusive).
|
|
4285
|
+
*
|
|
4286
|
+
* @param {string} attribute
|
|
4287
|
+
* @param {string | number} start
|
|
4288
|
+
* @param {string | number} end
|
|
4289
|
+
* @returns {string}
|
|
4290
|
+
*/
|
|
4291
|
+
Query.notBetween = (attribute, start, end) => new Query("notBetween", attribute, [start, end]).toString();
|
|
4292
|
+
/**
|
|
4293
|
+
* Filter resources where attribute does not start with value.
|
|
4294
|
+
*
|
|
4295
|
+
* @param {string} attribute
|
|
4296
|
+
* @param {string} value
|
|
4297
|
+
* @returns {string}
|
|
4298
|
+
*/
|
|
4299
|
+
Query.notStartsWith = (attribute, value) => new Query("notStartsWith", attribute, value).toString();
|
|
4300
|
+
/**
|
|
4301
|
+
* Filter resources where attribute does not end with value.
|
|
4302
|
+
*
|
|
4303
|
+
* @param {string} attribute
|
|
4304
|
+
* @param {string} value
|
|
4305
|
+
* @returns {string}
|
|
4306
|
+
*/
|
|
4307
|
+
Query.notEndsWith = (attribute, value) => new Query("notEndsWith", attribute, value).toString();
|
|
4308
|
+
/**
|
|
4309
|
+
* Filter resources where document was created before date.
|
|
4310
|
+
*
|
|
4311
|
+
* @param {string} value
|
|
4312
|
+
* @returns {string}
|
|
4313
|
+
*/
|
|
4314
|
+
Query.createdBefore = (value) => new Query("createdBefore", undefined, value).toString();
|
|
4315
|
+
/**
|
|
4316
|
+
* Filter resources where document was created after date.
|
|
4317
|
+
*
|
|
4318
|
+
* @param {string} value
|
|
4319
|
+
* @returns {string}
|
|
4320
|
+
*/
|
|
4321
|
+
Query.createdAfter = (value) => new Query("createdAfter", undefined, value).toString();
|
|
4322
|
+
/**
|
|
4323
|
+
* Filter resources where document was created between dates.
|
|
4324
|
+
*
|
|
4325
|
+
* @param {string} start
|
|
4326
|
+
* @param {string} end
|
|
4327
|
+
* @returns {string}
|
|
4328
|
+
*/
|
|
4329
|
+
Query.createdBetween = (start, end) => new Query("createdBetween", undefined, [start, end]).toString();
|
|
4330
|
+
/**
|
|
4331
|
+
* Filter resources where document was updated before date.
|
|
4332
|
+
*
|
|
4333
|
+
* @param {string} value
|
|
4334
|
+
* @returns {string}
|
|
4335
|
+
*/
|
|
4336
|
+
Query.updatedBefore = (value) => new Query("updatedBefore", undefined, value).toString();
|
|
4337
|
+
/**
|
|
4338
|
+
* Filter resources where document was updated after date.
|
|
4339
|
+
*
|
|
4340
|
+
* @param {string} value
|
|
4341
|
+
* @returns {string}
|
|
4342
|
+
*/
|
|
4343
|
+
Query.updatedAfter = (value) => new Query("updatedAfter", undefined, value).toString();
|
|
4344
|
+
/**
|
|
4345
|
+
* Filter resources where document was updated between dates.
|
|
4346
|
+
*
|
|
4347
|
+
* @param {string} start
|
|
4348
|
+
* @param {string} end
|
|
4349
|
+
* @returns {string}
|
|
4350
|
+
*/
|
|
4351
|
+
Query.updatedBetween = (start, end) => new Query("updatedBetween", undefined, [start, end]).toString();
|
|
3725
4352
|
Query.or = (queries) => new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString();
|
|
3726
4353
|
Query.and = (queries) => new Query("and", undefined, queries.map((query) => JSON.parse(query))).toString();
|
|
4354
|
+
/**
|
|
4355
|
+
* Filter resources where attribute is at a specific distance from the given coordinates.
|
|
4356
|
+
*
|
|
4357
|
+
* @param {string} attribute
|
|
4358
|
+
* @param {any[]} values
|
|
4359
|
+
* @param {number} distance
|
|
4360
|
+
* @param {boolean} meters
|
|
4361
|
+
* @returns {string}
|
|
4362
|
+
*/
|
|
4363
|
+
Query.distanceEqual = (attribute, values, distance, meters = true) => new Query("distanceEqual", attribute, [[values, distance, meters]]).toString();
|
|
4364
|
+
/**
|
|
4365
|
+
* Filter resources where attribute is not at a specific distance from the given coordinates.
|
|
4366
|
+
*
|
|
4367
|
+
* @param {string} attribute
|
|
4368
|
+
* @param {any[]} values
|
|
4369
|
+
* @param {number} distance
|
|
4370
|
+
* @param {boolean} meters
|
|
4371
|
+
* @returns {string}
|
|
4372
|
+
*/
|
|
4373
|
+
Query.distanceNotEqual = (attribute, values, distance, meters = true) => new Query("distanceNotEqual", attribute, [[values, distance, meters]]).toString();
|
|
4374
|
+
/**
|
|
4375
|
+
* Filter resources where attribute is at a distance greater than the specified value from the given coordinates.
|
|
4376
|
+
*
|
|
4377
|
+
* @param {string} attribute
|
|
4378
|
+
* @param {any[]} values
|
|
4379
|
+
* @param {number} distance
|
|
4380
|
+
* @param {boolean} meters
|
|
4381
|
+
* @returns {string}
|
|
4382
|
+
*/
|
|
4383
|
+
Query.distanceGreaterThan = (attribute, values, distance, meters = true) => new Query("distanceGreaterThan", attribute, [[values, distance, meters]]).toString();
|
|
4384
|
+
/**
|
|
4385
|
+
* Filter resources where attribute is at a distance less than the specified value from the given coordinates.
|
|
4386
|
+
*
|
|
4387
|
+
* @param {string} attribute
|
|
4388
|
+
* @param {any[]} values
|
|
4389
|
+
* @param {number} distance
|
|
4390
|
+
* @param {boolean} meters
|
|
4391
|
+
* @returns {string}
|
|
4392
|
+
*/
|
|
4393
|
+
Query.distanceLessThan = (attribute, values, distance, meters = true) => new Query("distanceLessThan", attribute, [[values, distance, meters]]).toString();
|
|
4394
|
+
/**
|
|
4395
|
+
* Filter resources where attribute intersects with the given geometry.
|
|
4396
|
+
*
|
|
4397
|
+
* @param {string} attribute
|
|
4398
|
+
* @param {any[]} values
|
|
4399
|
+
* @returns {string}
|
|
4400
|
+
*/
|
|
4401
|
+
Query.intersects = (attribute, values) => new Query("intersects", attribute, [values]).toString();
|
|
4402
|
+
/**
|
|
4403
|
+
* Filter resources where attribute does not intersect with the given geometry.
|
|
4404
|
+
*
|
|
4405
|
+
* @param {string} attribute
|
|
4406
|
+
* @param {any[]} values
|
|
4407
|
+
* @returns {string}
|
|
4408
|
+
*/
|
|
4409
|
+
Query.notIntersects = (attribute, values) => new Query("notIntersects", attribute, [values]).toString();
|
|
4410
|
+
/**
|
|
4411
|
+
* Filter resources where attribute crosses the given geometry.
|
|
4412
|
+
*
|
|
4413
|
+
* @param {string} attribute
|
|
4414
|
+
* @param {any[]} values
|
|
4415
|
+
* @returns {string}
|
|
4416
|
+
*/
|
|
4417
|
+
Query.crosses = (attribute, values) => new Query("crosses", attribute, [values]).toString();
|
|
4418
|
+
/**
|
|
4419
|
+
* Filter resources where attribute does not cross the given geometry.
|
|
4420
|
+
*
|
|
4421
|
+
* @param {string} attribute
|
|
4422
|
+
* @param {any[]} values
|
|
4423
|
+
* @returns {string}
|
|
4424
|
+
*/
|
|
4425
|
+
Query.notCrosses = (attribute, values) => new Query("notCrosses", attribute, [values]).toString();
|
|
4426
|
+
/**
|
|
4427
|
+
* Filter resources where attribute overlaps with the given geometry.
|
|
4428
|
+
*
|
|
4429
|
+
* @param {string} attribute
|
|
4430
|
+
* @param {any[]} values
|
|
4431
|
+
* @returns {string}
|
|
4432
|
+
*/
|
|
4433
|
+
Query.overlaps = (attribute, values) => new Query("overlaps", attribute, [values]).toString();
|
|
4434
|
+
/**
|
|
4435
|
+
* Filter resources where attribute does not overlap with the given geometry.
|
|
4436
|
+
*
|
|
4437
|
+
* @param {string} attribute
|
|
4438
|
+
* @param {any[]} values
|
|
4439
|
+
* @returns {string}
|
|
4440
|
+
*/
|
|
4441
|
+
Query.notOverlaps = (attribute, values) => new Query("notOverlaps", attribute, [values]).toString();
|
|
4442
|
+
/**
|
|
4443
|
+
* Filter resources where attribute touches the given geometry.
|
|
4444
|
+
*
|
|
4445
|
+
* @param {string} attribute
|
|
4446
|
+
* @param {any[]} values
|
|
4447
|
+
* @returns {string}
|
|
4448
|
+
*/
|
|
4449
|
+
Query.touches = (attribute, values) => new Query("touches", attribute, [values]).toString();
|
|
4450
|
+
/**
|
|
4451
|
+
* Filter resources where attribute does not touch the given geometry.
|
|
4452
|
+
*
|
|
4453
|
+
* @param {string} attribute
|
|
4454
|
+
* @param {any[]} values
|
|
4455
|
+
* @returns {string}
|
|
4456
|
+
*/
|
|
4457
|
+
Query.notTouches = (attribute, values) => new Query("notTouches", attribute, [values]).toString();
|
|
3727
4458
|
|
|
3728
4459
|
class Permission {
|
|
3729
4460
|
}
|
|
@@ -3951,7 +4682,7 @@ exports.CreditCard = void 0;
|
|
|
3951
4682
|
CreditCard["Mastercard"] = "mastercard";
|
|
3952
4683
|
CreditCard["Naranja"] = "naranja";
|
|
3953
4684
|
CreditCard["TarjetaShopping"] = "targeta-shopping";
|
|
3954
|
-
CreditCard["
|
|
4685
|
+
CreditCard["UnionPay"] = "unionpay";
|
|
3955
4686
|
CreditCard["Visa"] = "visa";
|
|
3956
4687
|
CreditCard["MIR"] = "mir";
|
|
3957
4688
|
CreditCard["Maestro"] = "maestro";
|
|
@@ -4165,6 +4896,7 @@ exports.ExecutionMethod = void 0;
|
|
|
4165
4896
|
ExecutionMethod["PATCH"] = "PATCH";
|
|
4166
4897
|
ExecutionMethod["DELETE"] = "DELETE";
|
|
4167
4898
|
ExecutionMethod["OPTIONS"] = "OPTIONS";
|
|
4899
|
+
ExecutionMethod["HEAD"] = "HEAD";
|
|
4168
4900
|
})(exports.ExecutionMethod || (exports.ExecutionMethod = {}));
|
|
4169
4901
|
|
|
4170
4902
|
exports.ImageGravity = void 0;
|
|
@@ -4205,5 +4937,6 @@ exports.Permission = Permission;
|
|
|
4205
4937
|
exports.Query = Query;
|
|
4206
4938
|
exports.Role = Role;
|
|
4207
4939
|
exports.Storage = Storage;
|
|
4940
|
+
exports.TablesDB = TablesDB;
|
|
4208
4941
|
exports.Teams = Teams;
|
|
4209
4942
|
//# sourceMappingURL=sdk.js.map
|