@appwrite.io/console 0.1.0-preview-0.1 → 0.1.1
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 +5 -5
- package/dist/cjs/sdk.js +44 -11
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +44 -12
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +44 -11
- package/docs/examples/{teams/update.md → console/variables.md} +3 -3
- package/docs/examples/databases/create-relationship-attribute.md +1 -1
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/index.ts +1 -0
- package/src/models.ts +32 -60
- package/src/query.ts +18 -0
- package/src/services/account.ts +6 -6
- package/src/services/console.ts +30 -0
- package/src/services/databases.ts +17 -16
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +32 -60
- package/types/query.d.ts +6 -0
- package/types/services/account.d.ts +6 -6
- package/types/services/console.d.ts +15 -0
- package/types/services/databases.d.ts +17 -12
package/dist/iife/sdk.js
CHANGED
|
@@ -55,6 +55,12 @@
|
|
|
55
55
|
Query.lessThanEqual = (attribute, value) => Query.addQuery(attribute, "lessThanEqual", value);
|
|
56
56
|
Query.greaterThan = (attribute, value) => Query.addQuery(attribute, "greaterThan", value);
|
|
57
57
|
Query.greaterThanEqual = (attribute, value) => Query.addQuery(attribute, "greaterThanEqual", value);
|
|
58
|
+
Query.isNull = (attribute) => `isNull("${attribute}")`;
|
|
59
|
+
Query.isNotNull = (attribute) => `isNotNull("${attribute}")`;
|
|
60
|
+
Query.between = (attribute, start, end) => `between("${attribute}", [${Query.parseValues(start)},${Query.parseValues(end)}])`;
|
|
61
|
+
Query.startsWith = (attribute, value) => Query.addQuery(attribute, "startsWith", value);
|
|
62
|
+
Query.endsWith = (attribute, value) => Query.addQuery(attribute, "endsWith", value);
|
|
63
|
+
Query.select = (attributes) => `select([${attributes.map((attr) => `"${attr}"`).join(",")}])`;
|
|
58
64
|
Query.search = (attribute, value) => Query.addQuery(attribute, "search", value);
|
|
59
65
|
Query.orderDesc = (attribute) => `orderDesc("${attribute}")`;
|
|
60
66
|
Query.orderAsc = (attribute) => `orderAsc("${attribute}")`;
|
|
@@ -96,7 +102,7 @@
|
|
|
96
102
|
'x-sdk-name': 'Console',
|
|
97
103
|
'x-sdk-platform': 'console',
|
|
98
104
|
'x-sdk-language': 'web',
|
|
99
|
-
'x-sdk-version': '0.1.
|
|
105
|
+
'x-sdk-version': '0.1.1',
|
|
100
106
|
'X-Appwrite-Response-Format': '1.0.0',
|
|
101
107
|
};
|
|
102
108
|
this.realtime = {
|
|
@@ -881,7 +887,7 @@
|
|
|
881
887
|
* password combination. This route will create a new session for the user.
|
|
882
888
|
*
|
|
883
889
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
884
|
-
* about session limits](/docs/authentication#limits).
|
|
890
|
+
* about session limits](/docs/authentication-security#limits).
|
|
885
891
|
*
|
|
886
892
|
* @param {string} email
|
|
887
893
|
* @param {string} password
|
|
@@ -926,7 +932,7 @@
|
|
|
926
932
|
* your Appwrite instance by default.
|
|
927
933
|
*
|
|
928
934
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
929
|
-
* about session limits](/docs/authentication#limits).
|
|
935
|
+
* about session limits](/docs/authentication-security#limits).
|
|
930
936
|
*
|
|
931
937
|
* @param {string} userId
|
|
932
938
|
* @param {string} email
|
|
@@ -1017,7 +1023,7 @@
|
|
|
1017
1023
|
* user.
|
|
1018
1024
|
*
|
|
1019
1025
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1020
|
-
* about session limits](/docs/authentication#limits).
|
|
1026
|
+
* about session limits](/docs/authentication-security#limits).
|
|
1021
1027
|
*
|
|
1022
1028
|
*
|
|
1023
1029
|
* @param {string} provider
|
|
@@ -1065,7 +1071,7 @@
|
|
|
1065
1071
|
* is valid for 15 minutes.
|
|
1066
1072
|
*
|
|
1067
1073
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1068
|
-
* about session limits](/docs/authentication#limits).
|
|
1074
|
+
* about session limits](/docs/authentication-security#limits).
|
|
1069
1075
|
*
|
|
1070
1076
|
* @param {string} userId
|
|
1071
1077
|
* @param {string} phone
|
|
@@ -1646,6 +1652,30 @@
|
|
|
1646
1652
|
}
|
|
1647
1653
|
}
|
|
1648
1654
|
|
|
1655
|
+
class Console extends Service {
|
|
1656
|
+
constructor(client) {
|
|
1657
|
+
super(client);
|
|
1658
|
+
}
|
|
1659
|
+
/**
|
|
1660
|
+
* Get Variables
|
|
1661
|
+
*
|
|
1662
|
+
* Get all Environment Variables that are relevant for the console.
|
|
1663
|
+
*
|
|
1664
|
+
* @throws {AppwriteException}
|
|
1665
|
+
* @returns {Promise}
|
|
1666
|
+
*/
|
|
1667
|
+
variables() {
|
|
1668
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1669
|
+
let path = '/console/variables';
|
|
1670
|
+
let payload = {};
|
|
1671
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
1672
|
+
return yield this.client.call('get', uri, {
|
|
1673
|
+
'content-type': 'application/json',
|
|
1674
|
+
}, payload);
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1649
1679
|
class Databases extends Service {
|
|
1650
1680
|
constructor(client) {
|
|
1651
1681
|
super(client);
|
|
@@ -2724,7 +2754,10 @@
|
|
|
2724
2754
|
});
|
|
2725
2755
|
}
|
|
2726
2756
|
/**
|
|
2727
|
-
* Create
|
|
2757
|
+
* Create Relationship Attribute
|
|
2758
|
+
*
|
|
2759
|
+
* Create relationship attribute. [Learn more about relationship
|
|
2760
|
+
* attributes](/docs/databases-relationships#relationship-attributes).
|
|
2728
2761
|
*
|
|
2729
2762
|
*
|
|
2730
2763
|
* @param {string} databaseId
|
|
@@ -3036,16 +3069,18 @@
|
|
|
3036
3069
|
/**
|
|
3037
3070
|
* Update Relationship Attribute
|
|
3038
3071
|
*
|
|
3072
|
+
* Update relationship attribute. [Learn more about relationship
|
|
3073
|
+
* attributes](/docs/databases-relationships#relationship-attributes).
|
|
3074
|
+
*
|
|
3039
3075
|
*
|
|
3040
3076
|
* @param {string} databaseId
|
|
3041
3077
|
* @param {string} collectionId
|
|
3042
3078
|
* @param {string} key
|
|
3043
|
-
* @param {boolean} twoWay
|
|
3044
3079
|
* @param {string} onDelete
|
|
3045
3080
|
* @throws {AppwriteException}
|
|
3046
3081
|
* @returns {Promise}
|
|
3047
3082
|
*/
|
|
3048
|
-
updateRelationshipAttribute(databaseId, collectionId, key,
|
|
3083
|
+
updateRelationshipAttribute(databaseId, collectionId, key, onDelete) {
|
|
3049
3084
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3050
3085
|
if (typeof databaseId === 'undefined') {
|
|
3051
3086
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -3058,9 +3093,6 @@
|
|
|
3058
3093
|
}
|
|
3059
3094
|
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
3060
3095
|
let payload = {};
|
|
3061
|
-
if (typeof twoWay !== 'undefined') {
|
|
3062
|
-
payload['twoWay'] = twoWay;
|
|
3063
|
-
}
|
|
3064
3096
|
if (typeof onDelete !== 'undefined') {
|
|
3065
3097
|
payload['onDelete'] = onDelete;
|
|
3066
3098
|
}
|
|
@@ -7821,6 +7853,7 @@
|
|
|
7821
7853
|
exports.AppwriteException = AppwriteException;
|
|
7822
7854
|
exports.Avatars = Avatars;
|
|
7823
7855
|
exports.Client = Client;
|
|
7856
|
+
exports.Console = Console;
|
|
7824
7857
|
exports.Databases = Databases;
|
|
7825
7858
|
exports.Functions = Functions;
|
|
7826
7859
|
exports.Graphql = Graphql;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Client,
|
|
1
|
+
import { Client, Console } from "@appwrite.io/console";
|
|
2
2
|
|
|
3
3
|
const client = new Client();
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const console = new Console(client);
|
|
6
6
|
|
|
7
7
|
client
|
|
8
8
|
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
|
9
9
|
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
10
|
;
|
|
11
11
|
|
|
12
|
-
const promise =
|
|
12
|
+
const promise = console.variables();
|
|
13
13
|
|
|
14
14
|
promise.then(function (response) {
|
|
15
15
|
console.log(response); // Success
|
|
@@ -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]', '
|
|
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.
|
|
5
|
+
"version": "0.1.1",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
package/src/client.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Client, Query, AppwriteException } from './client';
|
|
2
2
|
export { Account } from './services/account';
|
|
3
3
|
export { Avatars } from './services/avatars';
|
|
4
|
+
export { Console } from './services/console';
|
|
4
5
|
export { Databases } from './services/databases';
|
|
5
6
|
export { Functions } from './services/functions';
|
|
6
7
|
export { Graphql } from './services/graphql';
|
package/src/models.ts
CHANGED
|
@@ -746,11 +746,11 @@ export namespace Models {
|
|
|
746
746
|
*/
|
|
747
747
|
array?: boolean;
|
|
748
748
|
/**
|
|
749
|
-
* The
|
|
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
|
-
*
|
|
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
|
|
940
|
+
password?: string;
|
|
937
941
|
/**
|
|
938
942
|
* Password hashing algorithm.
|
|
939
943
|
*/
|
|
940
|
-
hash
|
|
944
|
+
hash?: string;
|
|
941
945
|
/**
|
|
942
946
|
* Password hashing algorithm configuration.
|
|
943
947
|
*/
|
|
944
|
-
hashOptions
|
|
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
|
*/
|
|
@@ -2594,4 +2545,25 @@ export namespace Models {
|
|
|
2594
2545
|
*/
|
|
2595
2546
|
buckets: Metric[];
|
|
2596
2547
|
}
|
|
2548
|
+
/**
|
|
2549
|
+
* Console Variables
|
|
2550
|
+
*/
|
|
2551
|
+
export type ConsoleVariables = {
|
|
2552
|
+
/**
|
|
2553
|
+
* CNAME target for your Appwrite custom domains.
|
|
2554
|
+
*/
|
|
2555
|
+
_APP_DOMAIN_TARGET: string;
|
|
2556
|
+
/**
|
|
2557
|
+
* Maximum file size allowed for file upload in bytes.
|
|
2558
|
+
*/
|
|
2559
|
+
_APP_STORAGE_LIMIT: number;
|
|
2560
|
+
/**
|
|
2561
|
+
* Maximum file size allowed for deployment in bytes.
|
|
2562
|
+
*/
|
|
2563
|
+
_APP_FUNCTIONS_SIZE_LIMIT: number;
|
|
2564
|
+
/**
|
|
2565
|
+
* Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'.
|
|
2566
|
+
*/
|
|
2567
|
+
_APP_USAGE_STATS: string;
|
|
2568
|
+
}
|
|
2597
2569
|
}
|
package/src/query.ts
CHANGED
|
@@ -21,6 +21,24 @@ export class Query {
|
|
|
21
21
|
static greaterThanEqual = (attribute: string, value: QueryTypes): string =>
|
|
22
22
|
Query.addQuery(attribute, "greaterThanEqual", value);
|
|
23
23
|
|
|
24
|
+
static isNull = (attribute: string): string =>
|
|
25
|
+
`isNull("${attribute}")`;
|
|
26
|
+
|
|
27
|
+
static isNotNull = (attribute: string): string =>
|
|
28
|
+
`isNotNull("${attribute}")`;
|
|
29
|
+
|
|
30
|
+
static between = (attribute: string, start: string|number, end: string|number): string =>
|
|
31
|
+
`between("${attribute}", [${Query.parseValues(start)},${Query.parseValues(end)}])`;
|
|
32
|
+
|
|
33
|
+
static startsWith = (attribute: string, value: string): string =>
|
|
34
|
+
Query.addQuery(attribute, "startsWith", value);
|
|
35
|
+
|
|
36
|
+
static endsWith = (attribute: string, value: string): string =>
|
|
37
|
+
Query.addQuery(attribute, "endsWith", value);
|
|
38
|
+
|
|
39
|
+
static select = (attributes: string[]): string =>
|
|
40
|
+
`select([${attributes.map((attr: string) => `"${attr}"`).join(",")}])`;
|
|
41
|
+
|
|
24
42
|
static search = (attribute: string, value: string): string =>
|
|
25
43
|
Query.addQuery(attribute, "search", value);
|
|
26
44
|
|
package/src/services/account.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
858
|
+
async updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> {
|
|
859
859
|
let path = '/account/status';
|
|
860
860
|
let payload: Payload = {};
|
|
861
861
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { AppwriteException, Client } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
import type { UploadProgress, Payload } from '../client';
|
|
5
|
+
|
|
6
|
+
export class Console extends Service {
|
|
7
|
+
|
|
8
|
+
constructor(client: Client)
|
|
9
|
+
{
|
|
10
|
+
super(client);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get Variables
|
|
15
|
+
*
|
|
16
|
+
* Get all Environment Variables that are relevant for the console.
|
|
17
|
+
*
|
|
18
|
+
* @throws {AppwriteException}
|
|
19
|
+
* @returns {Promise}
|
|
20
|
+
*/
|
|
21
|
+
async variables(): Promise<Models.ConsoleVariables> {
|
|
22
|
+
let path = '/console/variables';
|
|
23
|
+
let payload: Payload = {};
|
|
24
|
+
|
|
25
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
26
|
+
return await this.client.call('get', uri, {
|
|
27
|
+
'content-type': 'application/json',
|
|
28
|
+
}, payload);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -472,7 +472,7 @@ export class Databases extends Service {
|
|
|
472
472
|
* @throws {AppwriteException}
|
|
473
473
|
* @returns {Promise}
|
|
474
474
|
*/
|
|
475
|
-
async updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault
|
|
475
|
+
async updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean): Promise<Models.AttributeBoolean> {
|
|
476
476
|
if (typeof databaseId === 'undefined') {
|
|
477
477
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
478
478
|
}
|
|
@@ -577,7 +577,7 @@ export class Databases extends Service {
|
|
|
577
577
|
* @throws {AppwriteException}
|
|
578
578
|
* @returns {Promise}
|
|
579
579
|
*/
|
|
580
|
-
async updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault
|
|
580
|
+
async updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeDatetime> {
|
|
581
581
|
if (typeof databaseId === 'undefined') {
|
|
582
582
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
583
583
|
}
|
|
@@ -687,7 +687,7 @@ export class Databases extends Service {
|
|
|
687
687
|
* @throws {AppwriteException}
|
|
688
688
|
* @returns {Promise}
|
|
689
689
|
*/
|
|
690
|
-
async updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault
|
|
690
|
+
async updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeEmail> {
|
|
691
691
|
if (typeof databaseId === 'undefined') {
|
|
692
692
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
693
693
|
}
|
|
@@ -805,7 +805,7 @@ export class Databases extends Service {
|
|
|
805
805
|
* @throws {AppwriteException}
|
|
806
806
|
* @returns {Promise}
|
|
807
807
|
*/
|
|
808
|
-
async updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault
|
|
808
|
+
async updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string): Promise<Models.AttributeEnum> {
|
|
809
809
|
if (typeof databaseId === 'undefined') {
|
|
810
810
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
811
811
|
}
|
|
@@ -936,7 +936,7 @@ export class Databases extends Service {
|
|
|
936
936
|
* @throws {AppwriteException}
|
|
937
937
|
* @returns {Promise}
|
|
938
938
|
*/
|
|
939
|
-
async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault
|
|
939
|
+
async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number): Promise<Models.AttributeFloat> {
|
|
940
940
|
if (typeof databaseId === 'undefined') {
|
|
941
941
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
942
942
|
}
|
|
@@ -1075,7 +1075,7 @@ export class Databases extends Service {
|
|
|
1075
1075
|
* @throws {AppwriteException}
|
|
1076
1076
|
* @returns {Promise}
|
|
1077
1077
|
*/
|
|
1078
|
-
async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault
|
|
1078
|
+
async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number): Promise<Models.AttributeInteger> {
|
|
1079
1079
|
if (typeof databaseId === 'undefined') {
|
|
1080
1080
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1081
1081
|
}
|
|
@@ -1201,7 +1201,7 @@ export class Databases extends Service {
|
|
|
1201
1201
|
* @throws {AppwriteException}
|
|
1202
1202
|
* @returns {Promise}
|
|
1203
1203
|
*/
|
|
1204
|
-
async updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault
|
|
1204
|
+
async updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeIp> {
|
|
1205
1205
|
if (typeof databaseId === 'undefined') {
|
|
1206
1206
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1207
1207
|
}
|
|
@@ -1240,8 +1240,11 @@ export class Databases extends Service {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
1242
1242
|
/**
|
|
1243
|
-
* Create
|
|
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
|
|
@@ -1385,7 +1388,7 @@ export class Databases extends Service {
|
|
|
1385
1388
|
* @throws {AppwriteException}
|
|
1386
1389
|
* @returns {Promise}
|
|
1387
1390
|
*/
|
|
1388
|
-
async updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault
|
|
1391
|
+
async updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeString> {
|
|
1389
1392
|
if (typeof databaseId === 'undefined') {
|
|
1390
1393
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1391
1394
|
}
|
|
@@ -1495,7 +1498,7 @@ export class Databases extends Service {
|
|
|
1495
1498
|
* @throws {AppwriteException}
|
|
1496
1499
|
* @returns {Promise}
|
|
1497
1500
|
*/
|
|
1498
|
-
async updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault
|
|
1501
|
+
async updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise<Models.AttributeUrl> {
|
|
1499
1502
|
if (typeof databaseId === 'undefined') {
|
|
1500
1503
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1501
1504
|
}
|
|
@@ -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,
|
|
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/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Client, Query, AppwriteException } from './client';
|
|
2
2
|
export { Account } from './services/account';
|
|
3
3
|
export { Avatars } from './services/avatars';
|
|
4
|
+
export { Console } from './services/console';
|
|
4
5
|
export { Databases } from './services/databases';
|
|
5
6
|
export { Functions } from './services/functions';
|
|
6
7
|
export { Graphql } from './services/graphql';
|