@appwrite.io/console 0.1.0-preview-0.0 → 0.1.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 +1 -1
- package/dist/cjs/sdk.js +104 -6
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +104 -6
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +104 -6
- package/docs/examples/databases/create-relationship-attribute.md +18 -0
- package/docs/examples/{teams/update.md → databases/update-relationship-attribute.md} +3 -3
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +52 -56
- package/src/services/account.ts +6 -6
- package/src/services/databases.ts +114 -1
- package/types/models.d.ts +52 -56
- package/types/services/account.d.ts +6 -6
- package/types/services/databases.d.ts +36 -1
package/types/models.d.ts
CHANGED
|
@@ -721,6 +721,55 @@ export declare namespace Models {
|
|
|
721
721
|
*/
|
|
722
722
|
default?: string;
|
|
723
723
|
};
|
|
724
|
+
/**
|
|
725
|
+
* AttributeRelationship
|
|
726
|
+
*/
|
|
727
|
+
type AttributeRelationship = {
|
|
728
|
+
/**
|
|
729
|
+
* Attribute Key.
|
|
730
|
+
*/
|
|
731
|
+
key: string;
|
|
732
|
+
/**
|
|
733
|
+
* Attribute type.
|
|
734
|
+
*/
|
|
735
|
+
type: string;
|
|
736
|
+
/**
|
|
737
|
+
* Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
|
738
|
+
*/
|
|
739
|
+
status: string;
|
|
740
|
+
/**
|
|
741
|
+
* Is attribute required?
|
|
742
|
+
*/
|
|
743
|
+
required: boolean;
|
|
744
|
+
/**
|
|
745
|
+
* Is attribute an array?
|
|
746
|
+
*/
|
|
747
|
+
array?: boolean;
|
|
748
|
+
/**
|
|
749
|
+
* The ID of the related collection.
|
|
750
|
+
*/
|
|
751
|
+
relatedCollection: string;
|
|
752
|
+
/**
|
|
753
|
+
* The type of the relationship.
|
|
754
|
+
*/
|
|
755
|
+
relationType: string;
|
|
756
|
+
/**
|
|
757
|
+
* Is the relationship two-way?
|
|
758
|
+
*/
|
|
759
|
+
twoWay: boolean;
|
|
760
|
+
/**
|
|
761
|
+
* The key of the two-way relationship.
|
|
762
|
+
*/
|
|
763
|
+
twoWayKey: string;
|
|
764
|
+
/**
|
|
765
|
+
* How deleting the parent document will propagate to child documents.
|
|
766
|
+
*/
|
|
767
|
+
onDelete: string;
|
|
768
|
+
/**
|
|
769
|
+
* Whether this is the parent or child side of the relationship
|
|
770
|
+
*/
|
|
771
|
+
side: string;
|
|
772
|
+
};
|
|
724
773
|
/**
|
|
725
774
|
* Index
|
|
726
775
|
*/
|
|
@@ -888,15 +937,15 @@ export declare namespace Models {
|
|
|
888
937
|
/**
|
|
889
938
|
* Hashed user password.
|
|
890
939
|
*/
|
|
891
|
-
password
|
|
940
|
+
password?: string;
|
|
892
941
|
/**
|
|
893
942
|
* Password hashing algorithm.
|
|
894
943
|
*/
|
|
895
|
-
hash
|
|
944
|
+
hash?: string;
|
|
896
945
|
/**
|
|
897
946
|
* Password hashing algorithm configuration.
|
|
898
947
|
*/
|
|
899
|
-
hashOptions
|
|
948
|
+
hashOptions?: object;
|
|
900
949
|
/**
|
|
901
950
|
* User registration date in ISO 8601 format.
|
|
902
951
|
*/
|
|
@@ -1033,59 +1082,6 @@ export declare namespace Models {
|
|
|
1033
1082
|
*/
|
|
1034
1083
|
threads: number;
|
|
1035
1084
|
};
|
|
1036
|
-
/**
|
|
1037
|
-
* Account
|
|
1038
|
-
*/
|
|
1039
|
-
type Account<Preferences extends Models.Preferences> = {
|
|
1040
|
-
/**
|
|
1041
|
-
* User ID.
|
|
1042
|
-
*/
|
|
1043
|
-
$id: string;
|
|
1044
|
-
/**
|
|
1045
|
-
* User creation date in ISO 8601 format.
|
|
1046
|
-
*/
|
|
1047
|
-
$createdAt: string;
|
|
1048
|
-
/**
|
|
1049
|
-
* User update date in ISO 8601 format.
|
|
1050
|
-
*/
|
|
1051
|
-
$updatedAt: string;
|
|
1052
|
-
/**
|
|
1053
|
-
* User name.
|
|
1054
|
-
*/
|
|
1055
|
-
name: string;
|
|
1056
|
-
/**
|
|
1057
|
-
* User registration date in ISO 8601 format.
|
|
1058
|
-
*/
|
|
1059
|
-
registration: string;
|
|
1060
|
-
/**
|
|
1061
|
-
* User status. Pass `true` for enabled and `false` for disabled.
|
|
1062
|
-
*/
|
|
1063
|
-
status: boolean;
|
|
1064
|
-
/**
|
|
1065
|
-
* Password update time in ISO 8601 format.
|
|
1066
|
-
*/
|
|
1067
|
-
passwordUpdate: string;
|
|
1068
|
-
/**
|
|
1069
|
-
* User email address.
|
|
1070
|
-
*/
|
|
1071
|
-
email: string;
|
|
1072
|
-
/**
|
|
1073
|
-
* User phone number in E.164 format.
|
|
1074
|
-
*/
|
|
1075
|
-
phone: string;
|
|
1076
|
-
/**
|
|
1077
|
-
* Email verification status.
|
|
1078
|
-
*/
|
|
1079
|
-
emailVerification: boolean;
|
|
1080
|
-
/**
|
|
1081
|
-
* Phone verification status.
|
|
1082
|
-
*/
|
|
1083
|
-
phoneVerification: boolean;
|
|
1084
|
-
/**
|
|
1085
|
-
* User preferences as a key-value object
|
|
1086
|
-
*/
|
|
1087
|
-
prefs: Preferences;
|
|
1088
|
-
};
|
|
1089
1085
|
/**
|
|
1090
1086
|
* Preferences
|
|
1091
1087
|
*/
|
|
@@ -94,7 +94,7 @@ export declare class Account extends Service {
|
|
|
94
94
|
* @throws {AppwriteException}
|
|
95
95
|
* @returns {Promise}
|
|
96
96
|
*/
|
|
97
|
-
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.
|
|
97
|
+
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
|
|
98
98
|
/**
|
|
99
99
|
* Update Phone
|
|
100
100
|
*
|
|
@@ -211,7 +211,7 @@ export declare class Account extends Service {
|
|
|
211
211
|
* password combination. This route will create a new session for the user.
|
|
212
212
|
*
|
|
213
213
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
214
|
-
* about session limits](/docs/authentication#limits).
|
|
214
|
+
* about session limits](/docs/authentication-security#limits).
|
|
215
215
|
*
|
|
216
216
|
* @param {string} email
|
|
217
217
|
* @param {string} password
|
|
@@ -235,7 +235,7 @@ export declare class Account extends Service {
|
|
|
235
235
|
* your Appwrite instance by default.
|
|
236
236
|
*
|
|
237
237
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
238
|
-
* about session limits](/docs/authentication#limits).
|
|
238
|
+
* about session limits](/docs/authentication-security#limits).
|
|
239
239
|
*
|
|
240
240
|
* @param {string} userId
|
|
241
241
|
* @param {string} email
|
|
@@ -281,7 +281,7 @@ export declare class Account extends Service {
|
|
|
281
281
|
* user.
|
|
282
282
|
*
|
|
283
283
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
284
|
-
* about session limits](/docs/authentication#limits).
|
|
284
|
+
* about session limits](/docs/authentication-security#limits).
|
|
285
285
|
*
|
|
286
286
|
*
|
|
287
287
|
* @param {string} provider
|
|
@@ -303,7 +303,7 @@ export declare class Account extends Service {
|
|
|
303
303
|
* is valid for 15 minutes.
|
|
304
304
|
*
|
|
305
305
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
306
|
-
* about session limits](/docs/authentication#limits).
|
|
306
|
+
* about session limits](/docs/authentication-security#limits).
|
|
307
307
|
*
|
|
308
308
|
* @param {string} userId
|
|
309
309
|
* @param {string} phone
|
|
@@ -372,7 +372,7 @@ export declare class Account extends Service {
|
|
|
372
372
|
* @throws {AppwriteException}
|
|
373
373
|
* @returns {Promise}
|
|
374
374
|
*/
|
|
375
|
-
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.
|
|
375
|
+
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
|
|
376
376
|
/**
|
|
377
377
|
* Create Email Verification
|
|
378
378
|
*
|
|
@@ -374,6 +374,25 @@ export declare class Databases extends Service {
|
|
|
374
374
|
* @returns {Promise}
|
|
375
375
|
*/
|
|
376
376
|
updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault: string): Promise<Models.AttributeIp>;
|
|
377
|
+
/**
|
|
378
|
+
* Create Relationship Attribute
|
|
379
|
+
*
|
|
380
|
+
* Create relationship attribute. [Learn more about relationship
|
|
381
|
+
* attributes](docs/databases-relationships#relationship-attributes).
|
|
382
|
+
*
|
|
383
|
+
*
|
|
384
|
+
* @param {string} databaseId
|
|
385
|
+
* @param {string} collectionId
|
|
386
|
+
* @param {string} relatedCollectionId
|
|
387
|
+
* @param {string} type
|
|
388
|
+
* @param {boolean} twoWay
|
|
389
|
+
* @param {string} key
|
|
390
|
+
* @param {string} twoWayKey
|
|
391
|
+
* @param {string} onDelete
|
|
392
|
+
* @throws {AppwriteException}
|
|
393
|
+
* @returns {Promise}
|
|
394
|
+
*/
|
|
395
|
+
createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: string, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: string): Promise<Models.AttributeRelationship>;
|
|
377
396
|
/**
|
|
378
397
|
* Create String Attribute
|
|
379
398
|
*
|
|
@@ -461,6 +480,21 @@ export declare class Databases extends Service {
|
|
|
461
480
|
* @returns {Promise}
|
|
462
481
|
*/
|
|
463
482
|
deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}>;
|
|
483
|
+
/**
|
|
484
|
+
* Update Relationship Attribute
|
|
485
|
+
*
|
|
486
|
+
* Update relationship attribute. [Learn more about relationship
|
|
487
|
+
* attributes](docs/databases-relationships#relationship-attributes).
|
|
488
|
+
*
|
|
489
|
+
*
|
|
490
|
+
* @param {string} databaseId
|
|
491
|
+
* @param {string} collectionId
|
|
492
|
+
* @param {string} key
|
|
493
|
+
* @param {string} onDelete
|
|
494
|
+
* @throws {AppwriteException}
|
|
495
|
+
* @returns {Promise}
|
|
496
|
+
*/
|
|
497
|
+
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: string): Promise<Models.AttributeRelationship>;
|
|
464
498
|
/**
|
|
465
499
|
* List Documents
|
|
466
500
|
*
|
|
@@ -500,10 +534,11 @@ export declare class Databases extends Service {
|
|
|
500
534
|
* @param {string} databaseId
|
|
501
535
|
* @param {string} collectionId
|
|
502
536
|
* @param {string} documentId
|
|
537
|
+
* @param {string[]} queries
|
|
503
538
|
* @throws {AppwriteException}
|
|
504
539
|
* @returns {Promise}
|
|
505
540
|
*/
|
|
506
|
-
getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string): Promise<Document>;
|
|
541
|
+
getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
|
|
507
542
|
/**
|
|
508
543
|
* Update Document
|
|
509
544
|
*
|