@appwrite.io/console 0.1.0 → 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 +34 -3
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +34 -4
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +34 -3
- package/docs/examples/console/variables.md +18 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/index.ts +1 -0
- package/src/models.ts +21 -0
- package/src/query.ts +18 -0
- package/src/services/console.ts +30 -0
- package/src/services/databases.ts +11 -11
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +21 -0
- package/types/query.d.ts +6 -0
- package/types/services/console.d.ts +15 -0
- package/types/services/databases.d.ts +11 -11
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Appwrite Console SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
[](https://travis-ci.com/appwrite/sdk-generator)
|
|
6
6
|
[](https://twitter.com/appwrite)
|
|
7
7
|
[](https://appwrite.io/discord)
|
|
8
8
|
|
|
9
|
-
**This SDK is compatible with Appwrite server version
|
|
9
|
+
**This SDK is compatible with Appwrite server version 1.3.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**
|
|
10
10
|
|
|
11
11
|
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
|
12
12
|
|
|
@@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
|
|
|
33
33
|
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
|
-
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@0.1.
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@0.1.1"></script>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
|
|
@@ -96,10 +96,10 @@ account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')
|
|
|
96
96
|
|
|
97
97
|
### Learn more
|
|
98
98
|
You can use the following resources to learn more and get help
|
|
99
|
-
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-
|
|
99
|
+
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-web)
|
|
100
100
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
|
101
101
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
|
102
|
-
- 🚂 [Appwrite
|
|
102
|
+
- 🚂 [Appwrite Web Playground](https://github.com/appwrite/playground-for-web)
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
## Contribution
|
package/dist/cjs/sdk.js
CHANGED
|
@@ -57,6 +57,12 @@ Query.lessThan = (attribute, value) => Query.addQuery(attribute, "lessThan", val
|
|
|
57
57
|
Query.lessThanEqual = (attribute, value) => Query.addQuery(attribute, "lessThanEqual", value);
|
|
58
58
|
Query.greaterThan = (attribute, value) => Query.addQuery(attribute, "greaterThan", value);
|
|
59
59
|
Query.greaterThanEqual = (attribute, value) => Query.addQuery(attribute, "greaterThanEqual", value);
|
|
60
|
+
Query.isNull = (attribute) => `isNull("${attribute}")`;
|
|
61
|
+
Query.isNotNull = (attribute) => `isNotNull("${attribute}")`;
|
|
62
|
+
Query.between = (attribute, start, end) => `between("${attribute}", [${Query.parseValues(start)},${Query.parseValues(end)}])`;
|
|
63
|
+
Query.startsWith = (attribute, value) => Query.addQuery(attribute, "startsWith", value);
|
|
64
|
+
Query.endsWith = (attribute, value) => Query.addQuery(attribute, "endsWith", value);
|
|
65
|
+
Query.select = (attributes) => `select([${attributes.map((attr) => `"${attr}"`).join(",")}])`;
|
|
60
66
|
Query.search = (attribute, value) => Query.addQuery(attribute, "search", value);
|
|
61
67
|
Query.orderDesc = (attribute) => `orderDesc("${attribute}")`;
|
|
62
68
|
Query.orderAsc = (attribute) => `orderAsc("${attribute}")`;
|
|
@@ -98,7 +104,7 @@ class Client {
|
|
|
98
104
|
'x-sdk-name': 'Console',
|
|
99
105
|
'x-sdk-platform': 'console',
|
|
100
106
|
'x-sdk-language': 'web',
|
|
101
|
-
'x-sdk-version': '0.1.
|
|
107
|
+
'x-sdk-version': '0.1.1',
|
|
102
108
|
'X-Appwrite-Response-Format': '1.0.0',
|
|
103
109
|
};
|
|
104
110
|
this.realtime = {
|
|
@@ -1648,6 +1654,30 @@ class Avatars extends Service {
|
|
|
1648
1654
|
}
|
|
1649
1655
|
}
|
|
1650
1656
|
|
|
1657
|
+
class Console extends Service {
|
|
1658
|
+
constructor(client) {
|
|
1659
|
+
super(client);
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* Get Variables
|
|
1663
|
+
*
|
|
1664
|
+
* Get all Environment Variables that are relevant for the console.
|
|
1665
|
+
*
|
|
1666
|
+
* @throws {AppwriteException}
|
|
1667
|
+
* @returns {Promise}
|
|
1668
|
+
*/
|
|
1669
|
+
variables() {
|
|
1670
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1671
|
+
let path = '/console/variables';
|
|
1672
|
+
let payload = {};
|
|
1673
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
1674
|
+
return yield this.client.call('get', uri, {
|
|
1675
|
+
'content-type': 'application/json',
|
|
1676
|
+
}, payload);
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1651
1681
|
class Databases extends Service {
|
|
1652
1682
|
constructor(client) {
|
|
1653
1683
|
super(client);
|
|
@@ -2729,7 +2759,7 @@ class Databases extends Service {
|
|
|
2729
2759
|
* Create Relationship Attribute
|
|
2730
2760
|
*
|
|
2731
2761
|
* Create relationship attribute. [Learn more about relationship
|
|
2732
|
-
* attributes](docs/databases-relationships#relationship-attributes).
|
|
2762
|
+
* attributes](/docs/databases-relationships#relationship-attributes).
|
|
2733
2763
|
*
|
|
2734
2764
|
*
|
|
2735
2765
|
* @param {string} databaseId
|
|
@@ -3042,7 +3072,7 @@ class Databases extends Service {
|
|
|
3042
3072
|
* Update Relationship Attribute
|
|
3043
3073
|
*
|
|
3044
3074
|
* Update relationship attribute. [Learn more about relationship
|
|
3045
|
-
* attributes](docs/databases-relationships#relationship-attributes).
|
|
3075
|
+
* attributes](/docs/databases-relationships#relationship-attributes).
|
|
3046
3076
|
*
|
|
3047
3077
|
*
|
|
3048
3078
|
* @param {string} databaseId
|
|
@@ -7825,6 +7855,7 @@ exports.Account = Account;
|
|
|
7825
7855
|
exports.AppwriteException = AppwriteException;
|
|
7826
7856
|
exports.Avatars = Avatars;
|
|
7827
7857
|
exports.Client = Client;
|
|
7858
|
+
exports.Console = Console;
|
|
7828
7859
|
exports.Databases = Databases;
|
|
7829
7860
|
exports.Functions = Functions;
|
|
7830
7861
|
exports.Graphql = Graphql;
|