@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/dist/esm/sdk.js
CHANGED
|
@@ -96,7 +96,7 @@ class Client {
|
|
|
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
|
|
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 @@ class Account extends Service {
|
|
|
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 @@ class Account extends Service {
|
|
|
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 @@ class Account extends Service {
|
|
|
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 @@ class Account extends Service {
|
|
|
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
|
|
@@ -2723,6 +2723,64 @@ class Databases extends Service {
|
|
|
2723
2723
|
}, payload);
|
|
2724
2724
|
});
|
|
2725
2725
|
}
|
|
2726
|
+
/**
|
|
2727
|
+
* Create Relationship Attribute
|
|
2728
|
+
*
|
|
2729
|
+
* Create relationship attribute. [Learn more about relationship
|
|
2730
|
+
* attributes](docs/databases-relationships#relationship-attributes).
|
|
2731
|
+
*
|
|
2732
|
+
*
|
|
2733
|
+
* @param {string} databaseId
|
|
2734
|
+
* @param {string} collectionId
|
|
2735
|
+
* @param {string} relatedCollectionId
|
|
2736
|
+
* @param {string} type
|
|
2737
|
+
* @param {boolean} twoWay
|
|
2738
|
+
* @param {string} key
|
|
2739
|
+
* @param {string} twoWayKey
|
|
2740
|
+
* @param {string} onDelete
|
|
2741
|
+
* @throws {AppwriteException}
|
|
2742
|
+
* @returns {Promise}
|
|
2743
|
+
*/
|
|
2744
|
+
createRelationshipAttribute(databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete) {
|
|
2745
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2746
|
+
if (typeof databaseId === 'undefined') {
|
|
2747
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2748
|
+
}
|
|
2749
|
+
if (typeof collectionId === 'undefined') {
|
|
2750
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
2751
|
+
}
|
|
2752
|
+
if (typeof relatedCollectionId === 'undefined') {
|
|
2753
|
+
throw new AppwriteException('Missing required parameter: "relatedCollectionId"');
|
|
2754
|
+
}
|
|
2755
|
+
if (typeof type === 'undefined') {
|
|
2756
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
2757
|
+
}
|
|
2758
|
+
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
2759
|
+
let payload = {};
|
|
2760
|
+
if (typeof relatedCollectionId !== 'undefined') {
|
|
2761
|
+
payload['relatedCollectionId'] = relatedCollectionId;
|
|
2762
|
+
}
|
|
2763
|
+
if (typeof type !== 'undefined') {
|
|
2764
|
+
payload['type'] = type;
|
|
2765
|
+
}
|
|
2766
|
+
if (typeof twoWay !== 'undefined') {
|
|
2767
|
+
payload['twoWay'] = twoWay;
|
|
2768
|
+
}
|
|
2769
|
+
if (typeof key !== 'undefined') {
|
|
2770
|
+
payload['key'] = key;
|
|
2771
|
+
}
|
|
2772
|
+
if (typeof twoWayKey !== 'undefined') {
|
|
2773
|
+
payload['twoWayKey'] = twoWayKey;
|
|
2774
|
+
}
|
|
2775
|
+
if (typeof onDelete !== 'undefined') {
|
|
2776
|
+
payload['onDelete'] = onDelete;
|
|
2777
|
+
}
|
|
2778
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
2779
|
+
return yield this.client.call('post', uri, {
|
|
2780
|
+
'content-type': 'application/json',
|
|
2781
|
+
}, payload);
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2726
2784
|
/**
|
|
2727
2785
|
* Create String Attribute
|
|
2728
2786
|
*
|
|
@@ -2978,6 +3036,42 @@ class Databases extends Service {
|
|
|
2978
3036
|
}, payload);
|
|
2979
3037
|
});
|
|
2980
3038
|
}
|
|
3039
|
+
/**
|
|
3040
|
+
* Update Relationship Attribute
|
|
3041
|
+
*
|
|
3042
|
+
* Update relationship attribute. [Learn more about relationship
|
|
3043
|
+
* attributes](docs/databases-relationships#relationship-attributes).
|
|
3044
|
+
*
|
|
3045
|
+
*
|
|
3046
|
+
* @param {string} databaseId
|
|
3047
|
+
* @param {string} collectionId
|
|
3048
|
+
* @param {string} key
|
|
3049
|
+
* @param {string} onDelete
|
|
3050
|
+
* @throws {AppwriteException}
|
|
3051
|
+
* @returns {Promise}
|
|
3052
|
+
*/
|
|
3053
|
+
updateRelationshipAttribute(databaseId, collectionId, key, onDelete) {
|
|
3054
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3055
|
+
if (typeof databaseId === 'undefined') {
|
|
3056
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3057
|
+
}
|
|
3058
|
+
if (typeof collectionId === 'undefined') {
|
|
3059
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
3060
|
+
}
|
|
3061
|
+
if (typeof key === 'undefined') {
|
|
3062
|
+
throw new AppwriteException('Missing required parameter: "key"');
|
|
3063
|
+
}
|
|
3064
|
+
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
3065
|
+
let payload = {};
|
|
3066
|
+
if (typeof onDelete !== 'undefined') {
|
|
3067
|
+
payload['onDelete'] = onDelete;
|
|
3068
|
+
}
|
|
3069
|
+
const uri = new URL(this.client.config.endpoint + path);
|
|
3070
|
+
return yield this.client.call('patch', uri, {
|
|
3071
|
+
'content-type': 'application/json',
|
|
3072
|
+
}, payload);
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
2981
3075
|
/**
|
|
2982
3076
|
* List Documents
|
|
2983
3077
|
*
|
|
@@ -3065,10 +3159,11 @@ class Databases extends Service {
|
|
|
3065
3159
|
* @param {string} databaseId
|
|
3066
3160
|
* @param {string} collectionId
|
|
3067
3161
|
* @param {string} documentId
|
|
3162
|
+
* @param {string[]} queries
|
|
3068
3163
|
* @throws {AppwriteException}
|
|
3069
3164
|
* @returns {Promise}
|
|
3070
3165
|
*/
|
|
3071
|
-
getDocument(databaseId, collectionId, documentId) {
|
|
3166
|
+
getDocument(databaseId, collectionId, documentId, queries) {
|
|
3072
3167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3073
3168
|
if (typeof databaseId === 'undefined') {
|
|
3074
3169
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -3081,6 +3176,9 @@ class Databases extends Service {
|
|
|
3081
3176
|
}
|
|
3082
3177
|
let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
|
|
3083
3178
|
let payload = {};
|
|
3179
|
+
if (typeof queries !== 'undefined') {
|
|
3180
|
+
payload['queries'] = queries;
|
|
3181
|
+
}
|
|
3084
3182
|
const uri = new URL(this.client.config.endpoint + path);
|
|
3085
3183
|
return yield this.client.call('get', uri, {
|
|
3086
3184
|
'content-type': 'application/json',
|