@appwrite.io/console 0.1.0-preview-0.1 → 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/dist/iife/sdk.js CHANGED
@@ -96,7 +96,7 @@
96
96
  'x-sdk-name': 'Console',
97
97
  'x-sdk-platform': 'console',
98
98
  'x-sdk-language': 'web',
99
- 'x-sdk-version': '0.1.0-preview-0.1',
99
+ 'x-sdk-version': '0.1.0',
100
100
  'X-Appwrite-Response-Format': '1.0.0',
101
101
  };
102
102
  this.realtime = {
@@ -881,7 +881,7 @@
881
881
  * password combination. This route will create a new session for the user.
882
882
  *
883
883
  * A user is limited to 10 active sessions at a time by default. [Learn more
884
- * about session limits](/docs/authentication#limits).
884
+ * about session limits](/docs/authentication-security#limits).
885
885
  *
886
886
  * @param {string} email
887
887
  * @param {string} password
@@ -926,7 +926,7 @@
926
926
  * your Appwrite instance by default.
927
927
  *
928
928
  * A user is limited to 10 active sessions at a time by default. [Learn more
929
- * about session limits](/docs/authentication#limits).
929
+ * about session limits](/docs/authentication-security#limits).
930
930
  *
931
931
  * @param {string} userId
932
932
  * @param {string} email
@@ -1017,7 +1017,7 @@
1017
1017
  * user.
1018
1018
  *
1019
1019
  * A user is limited to 10 active sessions at a time by default. [Learn more
1020
- * about session limits](/docs/authentication#limits).
1020
+ * about session limits](/docs/authentication-security#limits).
1021
1021
  *
1022
1022
  *
1023
1023
  * @param {string} provider
@@ -1065,7 +1065,7 @@
1065
1065
  * is valid for 15 minutes.
1066
1066
  *
1067
1067
  * A user is limited to 10 active sessions at a time by default. [Learn more
1068
- * about session limits](/docs/authentication#limits).
1068
+ * about session limits](/docs/authentication-security#limits).
1069
1069
  *
1070
1070
  * @param {string} userId
1071
1071
  * @param {string} phone
@@ -2724,7 +2724,10 @@
2724
2724
  });
2725
2725
  }
2726
2726
  /**
2727
- * Create relationship Attribute
2727
+ * Create Relationship Attribute
2728
+ *
2729
+ * Create relationship attribute. [Learn more about relationship
2730
+ * attributes](docs/databases-relationships#relationship-attributes).
2728
2731
  *
2729
2732
  *
2730
2733
  * @param {string} databaseId
@@ -3036,16 +3039,18 @@
3036
3039
  /**
3037
3040
  * Update Relationship Attribute
3038
3041
  *
3042
+ * Update relationship attribute. [Learn more about relationship
3043
+ * attributes](docs/databases-relationships#relationship-attributes).
3044
+ *
3039
3045
  *
3040
3046
  * @param {string} databaseId
3041
3047
  * @param {string} collectionId
3042
3048
  * @param {string} key
3043
- * @param {boolean} twoWay
3044
3049
  * @param {string} onDelete
3045
3050
  * @throws {AppwriteException}
3046
3051
  * @returns {Promise}
3047
3052
  */
3048
- updateRelationshipAttribute(databaseId, collectionId, key, twoWay, onDelete) {
3053
+ updateRelationshipAttribute(databaseId, collectionId, key, onDelete) {
3049
3054
  return __awaiter(this, void 0, void 0, function* () {
3050
3055
  if (typeof databaseId === 'undefined') {
3051
3056
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -3058,9 +3063,6 @@
3058
3063
  }
3059
3064
  let path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
3060
3065
  let payload = {};
3061
- if (typeof twoWay !== 'undefined') {
3062
- payload['twoWay'] = twoWay;
3063
- }
3064
3066
  if (typeof onDelete !== 'undefined') {
3065
3067
  payload['onDelete'] = onDelete;
3066
3068
  }
@@ -9,7 +9,7 @@ client
9
9
  .setProject('5df5acd0d48c2') // Your project ID
10
10
  ;
11
11
 
12
- const promise = databases.createRelationshipAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', 'onetoone');
12
+ const promise = databases.createRelationshipAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '[RELATED_COLLECTION_ID]', 'oneToOne');
13
13
 
14
14
  promise.then(function (response) {
15
15
  console.log(response); // Success
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appwrite.io/console",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "0.1.0-preview-0.1",
5
+ "version": "0.1.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -104,7 +104,7 @@ class Client {
104
104
  'x-sdk-name': 'Console',
105
105
  'x-sdk-platform': 'console',
106
106
  'x-sdk-language': 'web',
107
- 'x-sdk-version': '0.1.0-preview-0.1',
107
+ 'x-sdk-version': '0.1.0',
108
108
  'X-Appwrite-Response-Format': '1.0.0',
109
109
  };
110
110
 
package/src/models.ts CHANGED
@@ -746,11 +746,11 @@ export namespace Models {
746
746
  */
747
747
  array?: boolean;
748
748
  /**
749
- * The Id of the related collection
749
+ * The ID of the related collection.
750
750
  */
751
751
  relatedCollection: string;
752
752
  /**
753
- * The type of the relationship
753
+ * The type of the relationship.
754
754
  */
755
755
  relationType: string;
756
756
  /**
@@ -758,13 +758,17 @@ export namespace Models {
758
758
  */
759
759
  twoWay: boolean;
760
760
  /**
761
- * The key of the two-way relationship
761
+ * The key of the two-way relationship.
762
762
  */
763
763
  twoWayKey: string;
764
764
  /**
765
- * Action to take on related documents when parent document is deleted
765
+ * How deleting the parent document will propagate to child documents.
766
766
  */
767
767
  onDelete: string;
768
+ /**
769
+ * Whether this is the parent or child side of the relationship
770
+ */
771
+ side: string;
768
772
  }
769
773
  /**
770
774
  * Index
@@ -933,15 +937,15 @@ export namespace Models {
933
937
  /**
934
938
  * Hashed user password.
935
939
  */
936
- password: string;
940
+ password?: string;
937
941
  /**
938
942
  * Password hashing algorithm.
939
943
  */
940
- hash: string;
944
+ hash?: string;
941
945
  /**
942
946
  * Password hashing algorithm configuration.
943
947
  */
944
- hashOptions: object;
948
+ hashOptions?: object;
945
949
  /**
946
950
  * User registration date in ISO 8601 format.
947
951
  */
@@ -1078,59 +1082,6 @@ export namespace Models {
1078
1082
  */
1079
1083
  threads: number;
1080
1084
  }
1081
- /**
1082
- * Account
1083
- */
1084
- export type Account<Preferences extends Models.Preferences> = {
1085
- /**
1086
- * User ID.
1087
- */
1088
- $id: string;
1089
- /**
1090
- * User creation date in ISO 8601 format.
1091
- */
1092
- $createdAt: string;
1093
- /**
1094
- * User update date in ISO 8601 format.
1095
- */
1096
- $updatedAt: string;
1097
- /**
1098
- * User name.
1099
- */
1100
- name: string;
1101
- /**
1102
- * User registration date in ISO 8601 format.
1103
- */
1104
- registration: string;
1105
- /**
1106
- * User status. Pass `true` for enabled and `false` for disabled.
1107
- */
1108
- status: boolean;
1109
- /**
1110
- * Password update time in ISO 8601 format.
1111
- */
1112
- passwordUpdate: string;
1113
- /**
1114
- * User email address.
1115
- */
1116
- email: string;
1117
- /**
1118
- * User phone number in E.164 format.
1119
- */
1120
- phone: string;
1121
- /**
1122
- * Email verification status.
1123
- */
1124
- emailVerification: boolean;
1125
- /**
1126
- * Phone verification status.
1127
- */
1128
- phoneVerification: boolean;
1129
- /**
1130
- * User preferences as a key-value object
1131
- */
1132
- prefs: Preferences;
1133
- }
1134
1085
  /**
1135
1086
  * Preferences
1136
1087
  */
@@ -211,7 +211,7 @@ export class Account extends Service {
211
211
  * @throws {AppwriteException}
212
212
  * @returns {Promise}
213
213
  */
214
- async updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.Account<Preferences>> {
214
+ async updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>> {
215
215
  if (typeof password === 'undefined') {
216
216
  throw new AppwriteException('Missing required parameter: "password"');
217
217
  }
@@ -493,7 +493,7 @@ export class Account extends Service {
493
493
  * password combination. This route will create a new session for the user.
494
494
  *
495
495
  * A user is limited to 10 active sessions at a time by default. [Learn more
496
- * about session limits](/docs/authentication#limits).
496
+ * about session limits](/docs/authentication-security#limits).
497
497
  *
498
498
  * @param {string} email
499
499
  * @param {string} password
@@ -542,7 +542,7 @@ export class Account extends Service {
542
542
  * your Appwrite instance by default.
543
543
  *
544
544
  * A user is limited to 10 active sessions at a time by default. [Learn more
545
- * about session limits](/docs/authentication#limits).
545
+ * about session limits](/docs/authentication-security#limits).
546
546
  *
547
547
  * @param {string} userId
548
548
  * @param {string} email
@@ -642,7 +642,7 @@ export class Account extends Service {
642
642
  * user.
643
643
  *
644
644
  * A user is limited to 10 active sessions at a time by default. [Learn more
645
- * about session limits](/docs/authentication#limits).
645
+ * about session limits](/docs/authentication-security#limits).
646
646
  *
647
647
  *
648
648
  * @param {string} provider
@@ -697,7 +697,7 @@ export class Account extends Service {
697
697
  * is valid for 15 minutes.
698
698
  *
699
699
  * A user is limited to 10 active sessions at a time by default. [Learn more
700
- * about session limits](/docs/authentication#limits).
700
+ * about session limits](/docs/authentication-security#limits).
701
701
  *
702
702
  * @param {string} userId
703
703
  * @param {string} phone
@@ -855,7 +855,7 @@ export class Account extends Service {
855
855
  * @throws {AppwriteException}
856
856
  * @returns {Promise}
857
857
  */
858
- async updateStatus<Preferences extends Models.Preferences>(): Promise<Models.Account<Preferences>> {
858
+ async updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> {
859
859
  let path = '/account/status';
860
860
  let payload: Payload = {};
861
861
 
@@ -1240,8 +1240,11 @@ export class Databases extends Service {
1240
1240
  }
1241
1241
 
1242
1242
  /**
1243
- * Create relationship Attribute
1243
+ * Create Relationship Attribute
1244
1244
  *
1245
+ * Create relationship attribute. [Learn more about relationship
1246
+ * attributes](docs/databases-relationships#relationship-attributes).
1247
+ *
1245
1248
  *
1246
1249
  * @param {string} databaseId
1247
1250
  * @param {string} collectionId
@@ -1600,16 +1603,18 @@ export class Databases extends Service {
1600
1603
  /**
1601
1604
  * Update Relationship Attribute
1602
1605
  *
1606
+ * Update relationship attribute. [Learn more about relationship
1607
+ * attributes](docs/databases-relationships#relationship-attributes).
1608
+ *
1603
1609
  *
1604
1610
  * @param {string} databaseId
1605
1611
  * @param {string} collectionId
1606
1612
  * @param {string} key
1607
- * @param {boolean} twoWay
1608
1613
  * @param {string} onDelete
1609
1614
  * @throws {AppwriteException}
1610
1615
  * @returns {Promise}
1611
1616
  */
1612
- async updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, twoWay?: boolean, onDelete?: string): Promise<Models.AttributeRelationship> {
1617
+ async updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: string): Promise<Models.AttributeRelationship> {
1613
1618
  if (typeof databaseId === 'undefined') {
1614
1619
  throw new AppwriteException('Missing required parameter: "databaseId"');
1615
1620
  }
@@ -1625,10 +1630,6 @@ export class Databases extends Service {
1625
1630
  let path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1626
1631
  let payload: Payload = {};
1627
1632
 
1628
- if (typeof twoWay !== 'undefined') {
1629
- payload['twoWay'] = twoWay;
1630
- }
1631
-
1632
1633
  if (typeof onDelete !== 'undefined') {
1633
1634
  payload['onDelete'] = onDelete;
1634
1635
  }
package/types/models.d.ts CHANGED
@@ -746,11 +746,11 @@ export declare namespace Models {
746
746
  */
747
747
  array?: boolean;
748
748
  /**
749
- * The Id of the related collection
749
+ * The ID of the related collection.
750
750
  */
751
751
  relatedCollection: string;
752
752
  /**
753
- * The type of the relationship
753
+ * The type of the relationship.
754
754
  */
755
755
  relationType: string;
756
756
  /**
@@ -758,13 +758,17 @@ export declare namespace Models {
758
758
  */
759
759
  twoWay: boolean;
760
760
  /**
761
- * The key of the two-way relationship
761
+ * The key of the two-way relationship.
762
762
  */
763
763
  twoWayKey: string;
764
764
  /**
765
- * Action to take on related documents when parent document is deleted
765
+ * How deleting the parent document will propagate to child documents.
766
766
  */
767
767
  onDelete: string;
768
+ /**
769
+ * Whether this is the parent or child side of the relationship
770
+ */
771
+ side: string;
768
772
  };
769
773
  /**
770
774
  * Index
@@ -933,15 +937,15 @@ export declare namespace Models {
933
937
  /**
934
938
  * Hashed user password.
935
939
  */
936
- password: string;
940
+ password?: string;
937
941
  /**
938
942
  * Password hashing algorithm.
939
943
  */
940
- hash: string;
944
+ hash?: string;
941
945
  /**
942
946
  * Password hashing algorithm configuration.
943
947
  */
944
- hashOptions: object;
948
+ hashOptions?: object;
945
949
  /**
946
950
  * User registration date in ISO 8601 format.
947
951
  */
@@ -1078,59 +1082,6 @@ export declare namespace Models {
1078
1082
  */
1079
1083
  threads: number;
1080
1084
  };
1081
- /**
1082
- * Account
1083
- */
1084
- type Account<Preferences extends Models.Preferences> = {
1085
- /**
1086
- * User ID.
1087
- */
1088
- $id: string;
1089
- /**
1090
- * User creation date in ISO 8601 format.
1091
- */
1092
- $createdAt: string;
1093
- /**
1094
- * User update date in ISO 8601 format.
1095
- */
1096
- $updatedAt: string;
1097
- /**
1098
- * User name.
1099
- */
1100
- name: string;
1101
- /**
1102
- * User registration date in ISO 8601 format.
1103
- */
1104
- registration: string;
1105
- /**
1106
- * User status. Pass `true` for enabled and `false` for disabled.
1107
- */
1108
- status: boolean;
1109
- /**
1110
- * Password update time in ISO 8601 format.
1111
- */
1112
- passwordUpdate: string;
1113
- /**
1114
- * User email address.
1115
- */
1116
- email: string;
1117
- /**
1118
- * User phone number in E.164 format.
1119
- */
1120
- phone: string;
1121
- /**
1122
- * Email verification status.
1123
- */
1124
- emailVerification: boolean;
1125
- /**
1126
- * Phone verification status.
1127
- */
1128
- phoneVerification: boolean;
1129
- /**
1130
- * User preferences as a key-value object
1131
- */
1132
- prefs: Preferences;
1133
- };
1134
1085
  /**
1135
1086
  * Preferences
1136
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.Account<Preferences>>;
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.Account<Preferences>>;
375
+ updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
376
376
  /**
377
377
  * Create Email Verification
378
378
  *
@@ -375,7 +375,10 @@ export declare class Databases extends Service {
375
375
  */
376
376
  updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault: string): Promise<Models.AttributeIp>;
377
377
  /**
378
- * Create relationship Attribute
378
+ * Create Relationship Attribute
379
+ *
380
+ * Create relationship attribute. [Learn more about relationship
381
+ * attributes](docs/databases-relationships#relationship-attributes).
379
382
  *
380
383
  *
381
384
  * @param {string} databaseId
@@ -480,16 +483,18 @@ export declare class Databases extends Service {
480
483
  /**
481
484
  * Update Relationship Attribute
482
485
  *
486
+ * Update relationship attribute. [Learn more about relationship
487
+ * attributes](docs/databases-relationships#relationship-attributes).
488
+ *
483
489
  *
484
490
  * @param {string} databaseId
485
491
  * @param {string} collectionId
486
492
  * @param {string} key
487
- * @param {boolean} twoWay
488
493
  * @param {string} onDelete
489
494
  * @throws {AppwriteException}
490
495
  * @returns {Promise}
491
496
  */
492
- updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, twoWay?: boolean, onDelete?: string): Promise<Models.AttributeRelationship>;
497
+ updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: string): Promise<Models.AttributeRelationship>;
493
498
  /**
494
499
  * List Documents
495
500
  *
@@ -1,18 +0,0 @@
1
- import { Client, Teams } from "appwrite";
2
-
3
- const client = new Client();
4
-
5
- const teams = new Teams(client);
6
-
7
- client
8
- .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9
- .setProject('5df5acd0d48c2') // Your project ID
10
- ;
11
-
12
- const promise = teams.update('[TEAM_ID]', '[NAME]');
13
-
14
- promise.then(function (response) {
15
- console.log(response); // Success
16
- }, function (error) {
17
- console.log(error); // Failure
18
- });