@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/esm/sdk.js
CHANGED
|
@@ -55,6 +55,12 @@ Query.lessThan = (attribute, value) => Query.addQuery(attribute, "lessThan", val
|
|
|
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 @@ class Client {
|
|
|
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 @@ class Account extends Service {
|
|
|
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 @@ class Account extends Service {
|
|
|
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 @@ class Account extends Service {
|
|
|
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 @@ class Account extends Service {
|
|
|
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 @@ class Avatars extends Service {
|
|
|
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 @@ class Databases extends Service {
|
|
|
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 @@ class Databases extends Service {
|
|
|
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 @@ class Databases extends Service {
|
|
|
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
|
}
|
|
@@ -7817,5 +7849,5 @@ class ID {
|
|
|
7817
7849
|
}
|
|
7818
7850
|
}
|
|
7819
7851
|
|
|
7820
|
-
export { Account, AppwriteException, Avatars, Client, Databases, Functions, Graphql, Health, ID, Locale, Permission, Projects, Query, Role, Storage, Teams, Users };
|
|
7852
|
+
export { Account, AppwriteException, Avatars, Client, Console, Databases, Functions, Graphql, Health, ID, Locale, Permission, Projects, Query, Role, Storage, Teams, Users };
|
|
7821
7853
|
//# sourceMappingURL=sdk.js.map
|