@appwrite.io/console 0.6.0 → 0.6.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 +2 -2
- package/dist/cjs/sdk.js +35 -13
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +35 -13
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +35 -13
- package/docs/examples/messaging/create-msg91provider.md +1 -1
- package/docs/examples/messaging/update-msg91provider.md +2 -2
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/flag.ts +1 -1
- package/src/id.ts +23 -4
- package/src/services/messaging.ts +10 -10
- package/types/enums/flag.d.ts +1 -1
- package/types/id.d.ts +2 -1
- package/types/services/messaging.d.ts +4 -4
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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)
|
|
@@ -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.6.
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@0.6.1"></script>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
|
package/dist/cjs/sdk.js
CHANGED
|
@@ -26,6 +26,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
26
26
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
27
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
28
|
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
32
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
33
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
class Service {
|
|
@@ -117,7 +123,7 @@ class Client {
|
|
|
117
123
|
'x-sdk-name': 'Console',
|
|
118
124
|
'x-sdk-platform': 'console',
|
|
119
125
|
'x-sdk-language': 'web',
|
|
120
|
-
'x-sdk-version': '0.6.
|
|
126
|
+
'x-sdk-version': '0.6.1',
|
|
121
127
|
'X-Appwrite-Response-Format': '1.5.0',
|
|
122
128
|
};
|
|
123
129
|
this.realtime = {
|
|
@@ -6621,14 +6627,14 @@ class Messaging extends Service {
|
|
|
6621
6627
|
*
|
|
6622
6628
|
* @param {string} providerId
|
|
6623
6629
|
* @param {string} name
|
|
6624
|
-
* @param {string}
|
|
6630
|
+
* @param {string} templateId
|
|
6625
6631
|
* @param {string} senderId
|
|
6626
6632
|
* @param {string} authKey
|
|
6627
6633
|
* @param {boolean} enabled
|
|
6628
6634
|
* @throws {AppwriteException}
|
|
6629
6635
|
* @returns {Promise}
|
|
6630
6636
|
*/
|
|
6631
|
-
createMsg91Provider(providerId, name,
|
|
6637
|
+
createMsg91Provider(providerId, name, templateId, senderId, authKey, enabled) {
|
|
6632
6638
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6633
6639
|
if (typeof providerId === 'undefined') {
|
|
6634
6640
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -6644,8 +6650,8 @@ class Messaging extends Service {
|
|
|
6644
6650
|
if (typeof name !== 'undefined') {
|
|
6645
6651
|
payload['name'] = name;
|
|
6646
6652
|
}
|
|
6647
|
-
if (typeof
|
|
6648
|
-
payload['
|
|
6653
|
+
if (typeof templateId !== 'undefined') {
|
|
6654
|
+
payload['templateId'] = templateId;
|
|
6649
6655
|
}
|
|
6650
6656
|
if (typeof senderId !== 'undefined') {
|
|
6651
6657
|
payload['senderId'] = senderId;
|
|
@@ -6670,13 +6676,13 @@ class Messaging extends Service {
|
|
|
6670
6676
|
* @param {string} providerId
|
|
6671
6677
|
* @param {string} name
|
|
6672
6678
|
* @param {boolean} enabled
|
|
6679
|
+
* @param {string} templateId
|
|
6673
6680
|
* @param {string} senderId
|
|
6674
6681
|
* @param {string} authKey
|
|
6675
|
-
* @param {string} from
|
|
6676
6682
|
* @throws {AppwriteException}
|
|
6677
6683
|
* @returns {Promise}
|
|
6678
6684
|
*/
|
|
6679
|
-
updateMsg91Provider(providerId, name, enabled, senderId, authKey
|
|
6685
|
+
updateMsg91Provider(providerId, name, enabled, templateId, senderId, authKey) {
|
|
6680
6686
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6681
6687
|
if (typeof providerId === 'undefined') {
|
|
6682
6688
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
@@ -6689,15 +6695,15 @@ class Messaging extends Service {
|
|
|
6689
6695
|
if (typeof enabled !== 'undefined') {
|
|
6690
6696
|
payload['enabled'] = enabled;
|
|
6691
6697
|
}
|
|
6698
|
+
if (typeof templateId !== 'undefined') {
|
|
6699
|
+
payload['templateId'] = templateId;
|
|
6700
|
+
}
|
|
6692
6701
|
if (typeof senderId !== 'undefined') {
|
|
6693
6702
|
payload['senderId'] = senderId;
|
|
6694
6703
|
}
|
|
6695
6704
|
if (typeof authKey !== 'undefined') {
|
|
6696
6705
|
payload['authKey'] = authKey;
|
|
6697
6706
|
}
|
|
6698
|
-
if (typeof from !== 'undefined') {
|
|
6699
|
-
payload['from'] = from;
|
|
6700
|
-
}
|
|
6701
6707
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6702
6708
|
return yield this.client.call('patch', uri, {
|
|
6703
6709
|
'content-type': 'application/json',
|
|
@@ -12883,14 +12889,30 @@ class Role {
|
|
|
12883
12889
|
}
|
|
12884
12890
|
}
|
|
12885
12891
|
|
|
12892
|
+
var _a, _ID_hexTimestamp;
|
|
12886
12893
|
class ID {
|
|
12887
12894
|
static custom(id) {
|
|
12888
12895
|
return id;
|
|
12889
12896
|
}
|
|
12890
|
-
static unique() {
|
|
12891
|
-
|
|
12897
|
+
static unique(padding = 7) {
|
|
12898
|
+
// Generate a unique ID with padding to have a longer ID
|
|
12899
|
+
const baseId = __classPrivateFieldGet(ID, _a, "m", _ID_hexTimestamp).call(ID);
|
|
12900
|
+
let randomPadding = '';
|
|
12901
|
+
for (let i = 0; i < padding; i++) {
|
|
12902
|
+
const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
|
|
12903
|
+
randomPadding += randomHexDigit;
|
|
12904
|
+
}
|
|
12905
|
+
return baseId + randomPadding;
|
|
12892
12906
|
}
|
|
12893
12907
|
}
|
|
12908
|
+
_a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {
|
|
12909
|
+
const now = new Date();
|
|
12910
|
+
const sec = Math.floor(now.getTime() / 1000);
|
|
12911
|
+
const msec = now.getMilliseconds();
|
|
12912
|
+
// Convert to hexadecimal
|
|
12913
|
+
const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0');
|
|
12914
|
+
return hexTimestamp;
|
|
12915
|
+
};
|
|
12894
12916
|
|
|
12895
12917
|
exports.AuthenticatorType = void 0;
|
|
12896
12918
|
(function (AuthenticatorType) {
|
|
@@ -13021,7 +13043,7 @@ exports.Flag = void 0;
|
|
|
13021
13043
|
Flag["Switzerland"] = "ch";
|
|
13022
13044
|
Flag["Chile"] = "cl";
|
|
13023
13045
|
Flag["China"] = "cn";
|
|
13024
|
-
Flag["
|
|
13046
|
+
Flag["CoteDIvoire"] = "ci";
|
|
13025
13047
|
Flag["Cameroon"] = "cm";
|
|
13026
13048
|
Flag["DemocraticRepublicOfTheCongo"] = "cd";
|
|
13027
13049
|
Flag["RepublicOfTheCongo"] = "cg";
|